master #75

Closed
Alienjack wants to merge 510 commits from Alienjack/AxibugEmuOnline_old:master into master
Showing only changes of commit 51a4419d25 - Show all commits

View File

@ -373,10 +373,12 @@ namespace AxibugEmuOnline.Server
ErrorCode errcode = ErrorCode.ErrorOk; ErrorCode errcode = ErrorCode.ErrorOk;
Data_RoomData room = GetRoomData(_c.RoomState.RoomID); Data_RoomData room = GetRoomData(_c.RoomState.RoomID);
if (room == null) if (room == null)
errcode = ErrorCode.ErrorRoomNotFound;
if (errcode == ErrorCode.ErrorOk)
{ {
errcode = ErrorCode.ErrorRoomNotFound;
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomChangePlayerWithJoy, (int)errcode, ProtoBufHelper.Serizlize(resp));
return;
}
Dictionary<uint, uint> newSlotIdx2JoyIdx = new Dictionary<uint, uint>(); Dictionary<uint, uint> newSlotIdx2JoyIdx = new Dictionary<uint, uint>();
foreach (var slotinfo in msg.SlotWithJoy) foreach (var slotinfo in msg.SlotWithJoy)
{ {
@ -385,15 +387,19 @@ namespace AxibugEmuOnline.Server
{ {
//且人不是自己,则不允许换位 //且人不是自己,则不允许换位
if (UID != _c.UID) if (UID != _c.UID)
errcode = ErrorCode.ErrorRoomSlotAlreadlyHadPlayer; break; {
errcode = ErrorCode.ErrorRoomSlotAlreadlyHadPlayer;
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomChangePlayerWithJoy, (int)errcode, ProtoBufHelper.Serizlize(resp));
return;
}
} }
newSlotIdx2JoyIdx[(uint)slotinfo.PlayerSlotIdx] = (uint)slotinfo.PlayerLocalJoyIdx; newSlotIdx2JoyIdx[(uint)slotinfo.PlayerSlotIdx] = (uint)slotinfo.PlayerLocalJoyIdx;
} }
room.SetPlayerSlotData(_c, ref newSlotIdx2JoyIdx); room.SetPlayerSlotData(_c, ref newSlotIdx2JoyIdx);
}
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomMyRoomStateChanged, (int)errcode, ProtoBufHelper.Serizlize(resp)); AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomChangePlayerWithJoy, (int)errcode, ProtoBufHelper.Serizlize(resp));
Protobuf_Room_MyRoom_State_Change(room.RoomID);
} }
public void OnHostPlayerUpdateStateRaw(Socket sk, byte[] reqData) public void OnHostPlayerUpdateStateRaw(Socket sk, byte[] reqData)