250501 커밋
This commit is contained in:
35
GameServer/Contents/GameMode/Helper/GameNotifyHelper.cs
Normal file
35
GameServer/Contents/GameMode/Helper/GameNotifyHelper.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
using ServerCore;
|
||||
|
||||
namespace GameServer.Contents.GameMode.Helper;
|
||||
|
||||
public class GameNotifyHelper
|
||||
{
|
||||
public static void broadcast_GS2C_NTF_GAME_STATE_UPDATE(InstanceRoom instanceRoom, GameModeState state, DateTime nextUpdatableTime)
|
||||
{
|
||||
var ntf = makeNtfGameStateUpdate(instanceRoom, state, nextUpdatableTime);
|
||||
Log.getLogger().debug($"broadcast_GS2C_NTF_BATTLE_INSTANCE_STATE ntf instanceRoom Id : {instanceRoom.getMap().m_room_id} data : {JsonConvert.SerializeObject(ntf.Message.NtfGameStateUpdate)}");
|
||||
instanceRoom.Broadcast(ntf);
|
||||
}
|
||||
|
||||
public static void send_GS2C_NTF_GAME_STATE_UPDATE(Player player, InstanceRoom instanceRoom, GameModeState state, DateTime nextUpdatableTime)
|
||||
{
|
||||
var ntf = makeNtfGameStateUpdate(instanceRoom, state, nextUpdatableTime);
|
||||
Log.getLogger().debug($"send_GS2C_NTF_GAME_STATE_UPDATE ntf instanceRoom Id : {instanceRoom.getMap().m_room_id} data : {JsonConvert.SerializeObject(ntf.Message.NtfGameStateUpdate)}");
|
||||
GameServerApp.getServerLogic().onSendPacket(player, ntf);
|
||||
}
|
||||
|
||||
public static ClientToGame makeNtfGameStateUpdate(InstanceRoom instanceRoom, GameModeState state, DateTime nextUpdatableTime)
|
||||
{
|
||||
ClientToGame ntf = new ClientToGame();
|
||||
ntf.Message = new ClientToGameMessage();
|
||||
ntf.Message.NtfGameStateUpdate = new ClientToGameMessage.Types.GS2C_NTF_GAME_STATE_UPDATE_NOTI();
|
||||
ntf.Message.NtfGameStateUpdate.CurrentState = state;
|
||||
ntf.Message.NtfGameStateUpdate.NextUpdatableTime = Timestamp.FromDateTime(nextUpdatableTime);
|
||||
|
||||
return ntf;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user