📄 uconnect.pas
字号:
begin
SendGradeList ('');
WhereStatus := ws_grade;
end;
BATTLEBUTTON_EXIT :
begin
GameServerConnectorList.AddSendServerData (GateNo, ConnectID, BG_USERCLOSE, nil, 0);
FboAllowDelete := true;
WhereStatus := ws_none;
end;
end;
end;
WINDOW_ROOMWINDOW :
begin
if WhereStatus <> ws_room then begin
// frmMain.WriteLogInfo ('Invalid Message Received (RoomWindow)');
exit;
end;
if (BattleRoom <> nil) or (User <> nil) then begin
frmMain.WriteLogInfo ('Invalid Connector (RoomWindow)');
exit;
end;
Case pcConfirm^.rButton of
BATTLEBUTTON_MAKE :
begin
RoomTitle := pcConfirm^.rText;
Room := BattleGroupList.CreateBattleRoom (Self, GroupTitle, Name, RetStr);
if Room <> nil then begin
BattleRoom := Room;
User := TUserList(Room.UserList).InitialLayerByPosition (Name, CharName, Self, Room, OWNER_XPOS + 1, BOTH_YPOS);
if User <> nil then begin
TUserList(Room.UserList).StartChar (Name, DR_2);
TUser(User).SendClass.SendChatMessage ('措访规俊 涝厘窍看嚼聪促', SAY_COLOR_SYSTEM);
WhereStatus := ws_inroom;
prd := @ComData.Data;
prd^.rMsg := SM_SHOWSPECIALWINDOW;
prd^.rWindow := WINDOW_ROOMWINDOW;
prd^.rType := 1;
Str := Room.GetRoomString;
SetWordString (prd^.rWordString, str);
ComData.Cnt := sizeof(TSShowListWindow) - sizeof(TWordString) + sizeofwordstring(prd^.rWordString);
ConnectorList.SendLatestRoomList (GroupTitle, @ComData, ComData.Cnt + SizeOf (Word));
end else begin
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end else begin
SendChatMessage (RetStr, SAY_COLOR_SYSTEM);
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end;
BATTLEBUTTON_FIGHT :
begin
RoomTitle := GetToken (pcConfirm^.rText, ':', 0);
Room := BattleGroupList.FightBattleRoom (Self, GroupTitle, RoomTitle, Name, RetStr);
if Room <> nil then begin
BattleRoom := Room;
User := TUserList(Room.UserList).InitialLayerByPosition (Name, CharName, Self, Room, FIGHTER_XPOS + 1, BOTH_YPOS);
if User <> nil then begin
TUserList(Room.UserList).StartChar (Name, DR_6);
TUser(User).SendClass.SendChatMessage ('措访规俊 涝厘窍看嚼聪促', SAY_COLOR_SYSTEM);
WhereStatus := ws_inroom;
prd := @ComData.Data;
prd^.rMsg := SM_SHOWSPECIALWINDOW;
prd^.rWindow := WINDOW_ROOMWINDOW;
prd^.rType := 3;
Str := Room.GetRoomString;
SetWordString (prd^.rWordString, str);
ComData.Cnt := sizeof(TSShowListWindow) - sizeof(TWordString) + sizeofwordstring(prd^.rWordString);
ConnectorList.SendLatestRoomList (GroupTitle, @ComData, ComData.Cnt + SizeOf (Word));
end else begin
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end else begin
SendChatMessage (RetStr, SAY_COLOR_SYSTEM);
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end;
BATTLEBUTTON_SHOW :
begin
RoomTitle := GetToken (pcConfirm^.rText, ':', 0);
Room := BattleGroupList.ViewBattleRoom (GroupTitle, RoomTitle, RetStr);
if Room <> nil then begin
BattleRoom := Room;
tmpUser := TUserList(Room.UserList).GetUserPointer (Room.Owner);
if tmpUser <> nil then begin
tmpUser.SendMapForViewer (Self);
Room.AddViewerConnector (Self);
SendChatMessage ('措访 包恩捞 矫累登菌嚼聪促', SAY_COLOR_SYSTEM);
WhereStatus := ws_inroom;
prd := @ComData.Data;
prd^.rMsg := SM_SHOWSPECIALWINDOW;
prd^.rWindow := WINDOW_ROOMWINDOW;
prd^.rType := 3;
Str := Room.GetRoomString;
SetWordString (prd^.rWordString, str);
ComData.Cnt := sizeof(TSShowListWindow) - sizeof(TWordString) + sizeofwordstring(prd^.rWordString);
ConnectorList.SendLatestRoomList (GroupTitle, @ComData, ComData.Cnt + SizeOf (Word));
end else begin
SendChatMessage ('矫胶袍 坷幅涝聪促. 促矫 急琶秦 林技夸', SAY_COLOR_SYSTEM);
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end else begin
SendChatMessage (RetStr, SAY_COLOR_SYSTEM);
if GroupTitle <> '' then
SendBattleRoomList (GroupTitle, 0);
end;
end;
BATTLEBUTTON_ROOMEXIT :
begin
WhereStatus := ws_group;
SendBattleGroupList (0);
end;
end;
end;
WINDOW_GRADEWINDOW :
begin
if WhereStatus <> ws_grade then begin
frmMain.WriteLogInfo ('Invalid Message Received (GradeWindow)');
exit;
end;
Case pcConfirm^.rButton of
BATTLEBUTTON_SHOWALL :
begin
if GradeWindowButtonDownTick + 100 > mmAnsTick then exit;
GradeWindowButtonDownTick := mmAnsTick;
WhereStatus := ws_grade;
Rankpart.rAge := GetCharAge;
RankPart.rStart := 1;
RankPart.rEnd := 50;
if BattleDBSender <> nil then begin
BattleDBSender.PutPacket (ConnectID, BSBD_GETRANKPART, 0, @RankPart, SizeOf (TGetRankPart));
end;
end;
BATTLEBUTTON_SHOWME :
begin
if GradeWindowButtonDownTick + 100 > mmAnsTick then exit;
GradeWindowButtonDownTick := mmAnsTick;
WhereStatus := ws_grade;
RankPart.rAge := GetCharAge;
if Grade < 25 then begin
RankPart.rStart := 1;
RankPart.rEnd := 50;
end else begin
RankPart.rStart := Grade - 24;
RankPart.rEnd := Grade + 25;
end;
if BattleDBSender <> nil then begin
BattleDBSender.PutPacket (ConnectID, BSBD_GETRANKPART, 0, @RankPart, SizeOf (TGetRankPart));
end;
end;
BATTLEBUTTON_GRADEEXIT :
begin
WhereStatus := ws_group;
SendBattleGroupList (0);
end;
end;
end;
end;
end;
Else
begin
pcSay := @aComData^.Data;
if pcSay^.rmsg = CM_SAY then begin
Str := GetWordString (pcSay^.rWordString);
if Str = '' then exit;
LimitStr := Copy (Str, 1, 88);
Str := LimitStr;
RetStr := Str;
for i := 0 to 15 do begin
RetStr := GetValidStr3 (RetStr, Strs[i], ' ');
if RetStr = '' then break;
end;
case Str[1] of
'!' :
begin
// if Points < 2000 then exit;
sColor := SAY_COLOR_GRADE0;
case Grade of
0 :
begin
if SysopScope >= 100 then begin
sColor := SAY_COLOR_GRADE5;
end;
if CurTick > ShoutedTick + 1000 then begin
ConnectorList.ShoutMessage ('{' + CharName + '} : ' + Copy (Str, 2, Length(Str) - 1), sColor);
ShoutedTick := CurTick;
end;
exit;
end;
30..41 : sColor := SAY_COLOR_GRADE0;
20..29 : sColor := SAY_COLOR_GRADE1;
12..19 : sColor := SAY_COLOR_GRADE2;
6..11 : sColor := SAY_COLOR_GRADE3;
2..5 : sColor := SAY_COLOR_GRADE4;
1 : sColor := SAY_COLOR_GRADE5;
end;
if SysopScope >= 100 then sColor := SAY_COLOR_GRADE5;
if CurTick > ShoutedTick + 1000 then begin
ConnectorList.ShoutMessage ('{' + CharName + '} : ' + Copy (Str, 2, Length(Str) - 1), sColor);
ShoutedTick := CurTick;
end;
exit;
end;
'/' :
begin
if Strs[0] = '/穿备' then begin
SendChatMessage (format ('<泅犁荤侩磊 : %d 疙>', [ConnectorList.Count]), SAY_COLOR_SYSTEM);
if WhereStatus = ws_inroom then begin
if BattleRoom = nil then begin
SendChatMessage (format (' 曼咯牢盔 : %d 疙', [ShareRoom.JoinCount]), SAY_COLOR_SYSTEM);
MirrorList.ShowViewerList (Self);
end else begin
SendChatMessage (format (' %s vs %s ', [TBattleRoom (BattleRoom).Owner, TBattleRoom (BattleRoom).Fighter]), SAY_COLOR_SYSTEM);
Str := TBattleRoom (BattleRoom).GetViewerString;
if Trim (Str) <> '' then SendChatMessage (Str, SAY_COLOR_NORMAL);
end;
end;
exit;
end;
end;
'@' :
begin
if Strs[0] = '@措傈辆丰' then begin
if BattleRoom = nil then begin
ExitShareRoom;
MirrorList.DelViewer (Self);
WhereStatus := ws_group;
SendBattleGroupList (0);
exit;
end else begin
if WhereStatus <> ws_inroom then exit;
if BattleRoom = nil then exit;
if (TBattleRoom (BattleRoom).OwnerConnector = Self) or
(TBattleRoom (BattleRoom).FighterConnector = Self) then begin
if (TBattleRoom (BattleRoom).BattleRoomStatus = brs_fighting) or
(TBattleRoom (BattleRoom).BattleRoomStatus = brs_nextready) then exit;
end;
TBattleRoom (BattleRoom).ExitConnector (Self);
WhereStatus := ws_room;
exit;
end;
end;
if Strs[0] = '@唱啊扁' then begin
if (WhereStatus = ws_room) or (WhereStatus = ws_group) then begin
GameServerConnectorList.AddSendServerData (GateNo, ConnectID, BG_USERCLOSE, nil, 0);
FboAllowDelete := true;
end;
exit;
end;
if Strs[0] = '@傈利犬牢' then begin
SendChatMessage (format ('%s : %d铰 %d菩 谗辫:%d %d痢 泅犁 %d困 (鉴困绰 傈眉鉴困客 促甫荐 乐澜)',
[CharName, Win, Lose, DisConnected, Points, Grade]), SAY_COLOR_SYSTEM);
exit;
end;
if (UpperCase(Strs[0]) = '@BAN') then begin
if WhereStatus <> ws_inroom then exit;
if BattleRoom <> nil then begin
if TBattleRoom (BattleRoom).OwnerConnector = Self then begin
if (TBattleRoom (BattleRoom).BattleRoomStatus = brs_fighting) or
(TBattleRoom (BattleRoom).BattleRoomStatus = brs_nextready) then exit;
TBattleRoom (BattleRoom).KickOutChar (Strs[1]);
exit;
end;
end;
end;
if Strs[0] = '@傍蜡规曼咯' then begin // ShareRoom
if WhereStatus = ws_inroom then exit;
if (SysopScope < 100) and (boUseShareRoom = false) then begin
SendChatMessage ('瘤陛篮 傍蜡规阑 荤侩且 荐 绝嚼聪促', SAY_COLOR_SYSTEM);
exit;
end;
if SysopScope < 100 then begin
if GradeStrList.Count > 1 then begin
if SearchGradeStrList (ServerName, CharName) = false then begin
SendChatMessage ('甸绢哎荐 绝嚼聪促. @傍蜡规备版 栏肺 备版窍绞矫坷', SAY_COLOR_SYSTEM);
exit;
end;
end;
end;
SXpos := 0;
SYpos := 0;
SearchPositionByServer (ServerName, SXpos, SYpos);
if (SXpos = 0) or (SYpos = 0) then begin
SXpos := SHARE_XPOS;
SYpos := SHARE_YPOS;
end;
User := TUserList(ShareRoom.UserList).InitialLayerByPosition (Name, CharName, Self, ShareRoom, SXpos + 1, SYpos);
if User <> nil then begin
pHideWindow := @ComData.Data;
pHideWindow^.rMsg := SM_HIDESPECIALWINDOW;
if WhereStatus = ws_group then begin
pHideWindow^.rWindow := WINDOW_GROUPWINDOW;
end else if WhereStatus = ws_room then begin
pHideWindow^.rWindow := WINDOW_ROOMWINDOW;
end else if WhereStatus = ws_grade then begin
pHideWindow^.rWindow := WINDOW_GRADEWINDOW;
end else begin
pHideWindow^.rWindow := WINDOW_NONE;
end;
ComData.Cnt := SizeOf (TSHideSpecialWindow);
AddSendData (@ComData, ComData.Cnt + SizeOf (Word));
WhereStatus := ws_inroom;
TUserList(ShareRoom.UserList).StartChar (Name, DR_4);
ShareRoom.AddJoinConnector (Self);
TUser(User).SendClass.SendChatMessage ('措访规俊 涝厘窍看嚼聪促', SAY_COLOR_SYSTEM);
end;
exit;
end;
if Strs[0] = '@傍蜡规备版' then begin
if WhereStatus = ws_inroom then exit;
if MirrorList.AddViewer (Strs [1], Self) = true then begin
pHideWindow := @ComData.Data;
pHideWindow^.rMsg := SM_HIDESPECIALWINDOW;
if WhereStatus = ws_group then begin
pHideWindow^.rWindow := WINDOW_GROUPWINDOW;
end else if WhereStatus = ws_room then begin
pHideWindow^.rWindow := WINDOW_ROOMWINDOW;
end else if WhereStatus = ws_grade then begin
pHideWindow^.rWindow := WINDOW_GRADEWINDOW;
end else begin
pHideWindow^.rWindow := WINDOW_NONE;
end;
ComData.Cnt := SizeOf (TSHideSpecialWindow);
AddSendData (@ComData, ComData.Cnt + SizeOf (Word));
SendChatMessage ('措访 包恩捞 矫累登菌嚼聪促', SAY_COLOR_SYSTEM);
WhereStatus := ws_inroom;
end else begin
SendChatMessage ('瘤沥茄 捞抚狼 厘家甫 茫阑 荐 绝嚼聪促', SAY_COLOR_SYSTEM);
end;
exit;
end;
if UpperCase (Strs[0]) = '@RELOAD' then begin
if SysopScope < 100 then exit;
GradeStrList.Clear;
GradeStrList.LoadFromFile (GRADE_FILENAME);
exit;
end;
end;
end;
{
if (UpperCase (RetStr) = '@CALL') then begin
if WhereStatus <> ws_inroom then exit;
if BattleRoom <> nil then exit;
// if doumiConnector <> Self then exit;
if SysopScope >= 100 then begin
RetStr := GetToken (Str, ' ', 1);
tmpConnector := ShareRoom.SearchConnector (RetStr);
tmpUser := TUserList (ShareRoom.UserList).GetUserPointer (tmpConnector.Name);
if tmpUser = nil then begin
SendChatMessage (format ('%s丛捞 绝嚼聪促.',[RetStr]), SAY_COLOR_SYSTEM);
end else begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -