초기커밋
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using MetaAssets;
|
||||
using ServerCommon.BusinessLogDomain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
internal static class AddressBusinessLogHelper
|
||||
{
|
||||
public static AddressLogInfo toAddressLogInfo(int worldMetaId, int landMetaId, int buildingMetaId, int floor, int instanceMetaId, string myhomeGuid, string ownerGuid)
|
||||
{
|
||||
var address_log_info = new AddressLogInfo();
|
||||
address_log_info.setAddressInfo(worldMetaId, landMetaId, buildingMetaId, floor, instanceMetaId, myhomeGuid, ownerGuid);
|
||||
return address_log_info;
|
||||
}
|
||||
|
||||
public static void setAddressInfo(this AddressLogInfo logData, int worldMetaId, int landMetaId, int buildingMetaId, int floor, int instanceMetaId, string myhomeGuid, string ownerGuid)
|
||||
{
|
||||
logData.WorldMetaId = worldMetaId;
|
||||
logData.LandMetaId = landMetaId;
|
||||
logData.BuildingMetaId = buildingMetaId;
|
||||
logData.Floor = floor;
|
||||
logData.InstanceMetaId = instanceMetaId;
|
||||
logData.MyhomeGuid = myhomeGuid;
|
||||
logData.OwnerGuid = ownerGuid;
|
||||
}
|
||||
}
|
||||
}
|
||||
57
GameServer/Contents/Location/Helper/LocationHelper.cs
Normal file
57
GameServer/Contents/Location/Helper/LocationHelper.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
internal static class LocationHelper
|
||||
{
|
||||
public static string getCurrentInstanceRoomId(this Player player)
|
||||
{
|
||||
var location_attribute = player.getOriginEntityAttribute<LocationAttribute>();
|
||||
NullReferenceCheckHelper.throwIfNull(location_attribute, () => $"location_attribute is null !!! - {player.toBasicString()}");
|
||||
|
||||
return location_attribute.CurrentIndunLocation.InstanceRoomId;
|
||||
}
|
||||
|
||||
public static UserLocationInfo getUserLocationInfo(this Player player)
|
||||
{
|
||||
var location_action = player.getEntityAction<LocationAction>();
|
||||
var server_logic = GameServerApp.getServerLogic();
|
||||
|
||||
var is_channel = server_logic.getServerType().toServerType() == ServerType.Channel ? 1 : 0;
|
||||
var channel_no = (is_channel == 1) ? (int)server_logic.getChannelNo() : 0;
|
||||
|
||||
var location_info = new UserLocationInfo
|
||||
{
|
||||
Id = location_action.getCurrentMapMId(),
|
||||
ChannelNumber = channel_no,
|
||||
IsChannel = is_channel
|
||||
};
|
||||
return location_info;
|
||||
}
|
||||
|
||||
public static PositionInfo getCurrentPositionInfo(this Player player)
|
||||
{
|
||||
var position_info = new PositionInfo();
|
||||
|
||||
var game_zone_action = player.getEntityAction<GameZoneAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(game_zone_action, () => $"game_zone_action is null !!! - {player.toBasicString()}");
|
||||
|
||||
var location_action = player.getEntityAction<LocationAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(location_action, () => $"location_action is null !!! - {player.toBasicString()}");
|
||||
|
||||
position_info.ServerName = GameServerApp.getServerLogic().getServerName();
|
||||
position_info.MapFileType = game_zone_action.getLinkedToMap()?.MapFileType ?? MapFileType.None;
|
||||
position_info.MapMid = location_action.getCurrentMapMId();
|
||||
position_info.RoomId = game_zone_action.getLinkedToMap()?.m_room_id ?? "";
|
||||
position_info.Pos = location_action.getCurrentPos();
|
||||
|
||||
return position_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
GameServer/Contents/Location/Helper/LocationNotifyHelper.cs
Normal file
31
GameServer/Contents/Location/Helper/LocationNotifyHelper.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
internal static class LocationNotifyHelper
|
||||
{
|
||||
public static bool send_S2C_NTF_SET_LOCATION(this Player player)
|
||||
{
|
||||
var location_action = player.getEntityAction<LocationAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(location_action, () => $"location_action is null !!! - {player.toBasicString()}");
|
||||
|
||||
var ntf_packet = new ClientToGame();
|
||||
ntf_packet.Message = new();
|
||||
ntf_packet.Message.SetLocation = new();
|
||||
|
||||
ntf_packet.Message.SetLocation.Pos = location_action.getCurrentPos();
|
||||
|
||||
if (false == GameServerApp.getServerLogic().onSendPacket(player, ntf_packet))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user