一、選擇大區
procedure tgamefunmgr.selectserverarea;
type
_buffer = packed record
_c1:byte;
len:byte;
cmd:byte;
flag:byte;
end;
var buffer:_buffer;
begin
buffer._c1:=$c1;
buffer.len:=4;
buffer.cmd:=$f4;
buffer.flag:=6;
pntgamesend(buffer,buffer.len,0,0);
end;
二、選擇線
procedure tgamefunmgr.selectline(id:word);
type
_buffer = packed record
_c1:byte;
len:byte;
cmd:byte;
flag:byte;
id:word;
end;
var buffer:_buffer;
begin
buffer._c1:=$c1;
buffer.len:=6;
buffer.cmd:=$f4;
buffer.flag:=3;
buffer.id:=id;
pntgamesend(buffer,buffer.len,0,0);
end;
三、登陸賬號
procedure tgamefunmgr.login(account, psw: pchar);
type
_buffer = packed record
_c1:byte;
len:byte;
cmd:byte;
flag:byte;//1
account:array [0..9] of byte;
psw:array [0..9] of byte;
ltime:cardinal;
ver:array [0..4] of byte;
key:array [0..15] of byte;
end;
var buffer:_buffer;
begin
zeromemory(@buffer,sizeof(_buffer));
buffer._c1:=$c1;
buffer.len:=49;
buffer.cmd:=$f1;
buffer.flag:=1;
buffer.ltime:=gettickcount();
copymemory(pointer(account),account,length(account));
copymemory(@buffer.account[0],account,length(account));
myloginencode(@buffer.account[0],10);
copymemory(@buffer.psw[0],psw,length(psw));
myloginencode(@buffer.psw[0],10);
copymemory(@buffer.ver[0],pchar(c_ver),length(c_ver));
copymemory(@buffer.key[0],pchar(c_clientkey),length(c_clientkey));
myencode(@buffer,sizeof(_buffer));
plogin(buffer.flag,buffer.len-3);
pntgamesend(buffer,buffer.len,1,0);
end;
四、建立角色
procedure tgamefunmgr.createrole(name: pchar);
type
_buffer = packed record
_c1:byte; //c1
len:byte;
cmd:byte; //f3
flag:byte; //01
name:array [0..9] of byte;
job:byte; //$10法師 $20劍士 $30弓箭
end;
var buffer:_buffer;
begin
zeromemory(@buffer,sizeof(_buffer));
buffer._c1:=$c1;
buffer.len:=$f;
buffer.cmd:=$f3;
buffer.flag:=1;
copymemory(@buffer.name[0],name,length(name));
buffer.job:=$10;
myencode(@buffer,sizeof(_buffer));
pcreaterole(buffer.flag,sizeof(_buffer) - 3);
pntgamesend(buffer,buffer.len,0,0);
end;
五、刪除角色
procedure tgamefunmgr.deleterole(name, key: pchar;slot:integer);
type
_buffer = packed record
_c1:byte; //c1
len:byte;
cmd:byte; //f3
flag:byte; //02
name:array [0..9] of byte;
key:array [0..6] of byte; //身份證後7位
end;
var buffer:_buffer;
begin
pcardinal(roleslot)^:= slot; //對應角色序號
zeromemory(@buffer,sizeof(_buffer));
buffer._c1:=$c1;
buffer.len:=$15;
buffer.cmd:=$f3;
buffer.flag:=2;
copymemory(@buffer.name[0],name,length(name));
copymemory(@buffer.key[0],key,length(key));
myencode(@buffer,sizeof(_buffer));
pcreaterole(buffer.flag,sizeof(_buffer) - 3);
pntgamesend(buffer,buffer.len,0,0);
end;
六、選角色進入遊戲
procedure tgamefunmgr.enteringame(name:pchar;slot:integer);
type
_buffer = packed record
_c1:byte; //c1
len:byte;
cmd:byte; //f3
flag:byte; //15
name:array [0..9] of byte;
end;
var buffer:_buffer;
begin
pcardinal(roleslot)^:= slot; //對應角色序號
zeromemory(@buffer,sizeof(_buffer));
buffer._c1:=$c1;
buffer.len:=$e;
buffer.cmd:=$f3;
buffer.flag:=$15;
copymemory(@buffer.name[0],name,length(name));
myencode(@buffer,sizeof(_buffer));
pcreaterole(buffer.flag,sizeof(_buffer) - 3);
pntgamesend(buffer,buffer.len,0,0);
end;
七、登出遊戲
procedure tgamefunmgr.exitgame;
type
_buffer = packed record
_c1:byte; //c1
len:byte;
cmd:byte; //f1
data:word;
end;
var buffer:_buffer;
begin
buffer._c1:=$c1;
buffer.len:=5;
buffer.cmd:=$f1;
buffer.data:=$102;
myencode(@buffer,sizeof(_buffer));
pntgamesend(buffer,buffer.len,1,0);
end;
PHP實現自動登陸的思路分析
經常在做 的時候需要用到一周內免登陸,乙個月內免登陸這種需求。要實現只能通過cookie來實現了。那具體的實現過程是怎樣的呢?方法 步驟 1首先在使用者第一次登陸的時候,如果勾選了一周內免登陸,則在登陸操作完成之後,儲存乙個自動登入的cookie,這個cookie可以是 value是使用者的 id ...
用事物實現登陸
1.在ado中使用儲存過程 use userdb1 select from t users create proc usp login uname varchar 50 password varchar 50 result bit output 布林型別的引數,是用來返回值的,設定儲存使用者登入是否...
expect實現自動登陸
1.首先安裝expect2.指令碼編寫,下面是乙個通過ssh登陸遠端機器 gll5530 的例子,密碼 wzj.1989 opt exptools bin expect f set timeout 30 spawn ssh gll5530 expect password send wzj.1989 ...