### 新增IO 类

### 新增MD5 类

### 新增Mysql 类

### 新增Timer 类
This commit is contained in:
lenheart
2024-09-20 19:24:32 +08:00
parent 237bcf8719
commit 7f547f5fd4
21 changed files with 1234 additions and 16 deletions

View File

@@ -204,4 +204,64 @@ class World {
function SendPartyInfoToAll(Party) {
Sq_GameWorld_SendPartyInfoToAll(Sq_Get_GameWorld(), Party.C_Object);
}
//获取在线玩家列表表头
function api_gameworld_user_map_begin() {
local Begin = Sq_New_Point(4);
Sq_CallFunc(S_Ptr("0x80F78A6"), "int", ["pointer", "pointer"], Begin, Ptr_Operation_A2S(Sq_Get_GameWorld(), 308));
return Begin;
}
//获取在线玩家列表表尾
function api_gameworld_user_map_end() {
local End = Sq_New_Point(4);
Sq_CallFunc(S_Ptr("0x80F78CC"), "int", ["pointer", "pointer"], End, Ptr_Operation_A2S(Sq_Get_GameWorld(), 308));
return End;
}
//获取当前正在遍历的玩家
function api_gameworld_user_map_get(it) {
local Buf = Sq_CallFunc(S_Ptr("0x80F7944"), "pointer", ["pointer"], it);
local Buf2 = Ptr_Operation_A2S(Buf, 4);
local Buf3 = Sq_ReadPoint(Buf2);
return Buf3;
}
//迭代器指针自增
function api_gameworld_user_map_next(it) {
local Next = Sq_New_Point(4);
Sq_CallFunc(S_Ptr("0x80F7906"), "pointer", ["pointer", "pointer"], Next, it);
Sq_Delete_Point(Next);
return Next;
}
//获取在线玩家列表
function GetOnlinePlayer() {
local PlayerArr = [];
//遍历在线玩家列表
local it = api_gameworld_user_map_begin();
local end = api_gameworld_user_map_end();
//判断在线玩家列表遍历是否已结束
while (Sq_CallFunc(S_Ptr("0x80F78F2"), "bool", ["pointer", "pointer"], it, end)) {
//当前被遍历到的玩家
local user = api_gameworld_user_map_get(it);
local SUser = User(user);
if (SUser) PlayerArr.append(SUser);
//继续遍历下一个玩家
api_gameworld_user_map_next(it);
}
Sq_Delete_Point(it);
Sq_Delete_Point(end);
return PlayerArr;
}
}