本地化服务端
This commit is contained in:
parent
bb77fd95d6
commit
7d96b3a209
@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Network;
|
||||
using PolarisServer.Packets;
|
||||
using PolarisServer.Packets.Handlers;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Network;
|
||||
using PSO2SERVER.Packets;
|
||||
using PSO2SERVER.Packets.Handlers;
|
||||
using PSO2SERVER.Zone;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public class Client
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public class ConfigComment : Attribute
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace PolarisServer
|
||||
public class Config
|
||||
{
|
||||
private readonly string _configFile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) +
|
||||
Path.DirectorySeparatorChar + "PolarisServer.cfg";
|
||||
Path.DirectorySeparatorChar + "Server.cfg";
|
||||
|
||||
// Settings
|
||||
[ConfigComment("The address to bind to")]
|
||||
@ -35,7 +35,7 @@ namespace PolarisServer
|
||||
[ConfigComment("Port of the database server")]
|
||||
public string DatabasePort = "3306";
|
||||
|
||||
[ConfigComment("Name of the database which contains the Polaris data")]
|
||||
[ConfigComment("Name of the database which contains the Server data")]
|
||||
public string DatabaseName = "pso2server";
|
||||
|
||||
[ConfigComment("Username for logging into the database server")]
|
||||
@ -145,9 +145,9 @@ namespace PolarisServer
|
||||
|
||||
public void SettingsChanged()
|
||||
{
|
||||
PolarisApp.BindAddress = BindAddress;
|
||||
ServerApp.BindAddress = BindAddress;
|
||||
Logger.VerbosePackets = VerbosePackets;
|
||||
PolarisApp.Instance.Server.PingTimer.Interval = 1000 * PingTime;
|
||||
ServerApp.Instance.Server.PingTimer.Interval = 1000 * PingTime;
|
||||
}
|
||||
|
||||
public bool SetField(string name, string value)
|
||||
|
@ -7,14 +7,14 @@ using System.Threading;
|
||||
using System.Timers;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Packets;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Packets;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Zone;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public delegate void ConsoleCommandDelegate(string[] args, int length, string full, Client client);
|
||||
|
||||
@ -88,7 +88,7 @@ namespace PolarisServer
|
||||
ConsoleKey.Delete
|
||||
};
|
||||
|
||||
private const string Prompt = "Polaris> ";
|
||||
private const string Prompt = "[CMD]> ";
|
||||
|
||||
private string _commandLine = string.Empty;
|
||||
private int _commandIndex;
|
||||
@ -110,7 +110,7 @@ namespace PolarisServer
|
||||
|
||||
public ConsoleSystem()
|
||||
{
|
||||
Console.Title = "Polaris";
|
||||
Console.Title = "梦幻之星OL2";
|
||||
Console.CursorVisible = true;
|
||||
SetSize(80, 24);
|
||||
|
||||
@ -140,7 +140,7 @@ namespace PolarisServer
|
||||
{
|
||||
BlankDrawnCommandLine();
|
||||
|
||||
var useColors = PolarisApp.Config.UseConsoleColors;
|
||||
var useColors = ServerApp.Config.UseConsoleColors;
|
||||
var saveColor = Console.ForegroundColor;
|
||||
|
||||
Console.SetCursorPosition(0, _commandRowInConsole);
|
||||
@ -190,24 +190,24 @@ namespace PolarisServer
|
||||
|
||||
private string AssembleInfoBar()
|
||||
{
|
||||
if (PolarisApp.Instance != null && PolarisApp.Instance.Server != null)
|
||||
if (ServerApp.Instance != null && ServerApp.Instance.Server != null)
|
||||
{
|
||||
var clients = PolarisApp.Instance.Server.Clients.Count;
|
||||
var clients = ServerApp.Instance.Server.Clients.Count;
|
||||
float usage = Process.GetCurrentProcess().PrivateMemorySize64 / 1024 / 1024;
|
||||
|
||||
var time = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
|
||||
|
||||
return string.Format("Clients: {0} | Memory: {1} MB | {2}", clients, usage, time);
|
||||
return string.Format("当前玩家: {0} | 实时内存: {1} MB | {2}", clients, usage, time);
|
||||
}
|
||||
|
||||
return "Initializing...";
|
||||
return "正在初始化...";
|
||||
}
|
||||
|
||||
private void TimerRefresh(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
lock (_consoleLock)
|
||||
{
|
||||
Console.Title = "Polaris - " + AssembleInfoBar();
|
||||
Console.Title = "梦幻之星OL2 - " + AssembleInfoBar();
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ namespace PolarisServer
|
||||
{
|
||||
try
|
||||
{
|
||||
PolarisApp.ConsoleSystem.CheckInput();
|
||||
ServerApp.ConsoleSystem.CheckInput();
|
||||
}
|
||||
catch (ThreadInterruptedException ex)
|
||||
{
|
||||
@ -390,7 +390,7 @@ namespace PolarisServer
|
||||
Commands.Add(tellLoc);
|
||||
|
||||
// Exit
|
||||
var exit = new ConsoleCommand(Exit, "exit", "quit") { Help = "Close the Polaris Server" };
|
||||
var exit = new ConsoleCommand(Exit, "exit", "quit") { Help = "Close the PSO2 Server" };
|
||||
Commands.Add(exit);
|
||||
}
|
||||
|
||||
@ -575,23 +575,23 @@ namespace PolarisServer
|
||||
|
||||
private void Config(string[] args, int length, string full, Client client)
|
||||
{
|
||||
var fields = PolarisApp.Config.GetType().GetFields();
|
||||
var fields = ServerApp.Config.GetType().GetFields();
|
||||
var field = fields.FirstOrDefault(o => o.Name == args[1]);
|
||||
|
||||
switch (args[1].ToLower())
|
||||
{
|
||||
case "save":
|
||||
PolarisApp.Config.Save();
|
||||
ServerApp.Config.Save();
|
||||
break;
|
||||
|
||||
case "load":
|
||||
PolarisApp.Config.Load();
|
||||
ServerApp.Config.Load();
|
||||
break;
|
||||
|
||||
case "list":
|
||||
Logger.WriteCommand(client, "[CMD] 设置选项");
|
||||
foreach (var f in fields)
|
||||
Logger.WriteCommand(client, "[CMD] {0} = {1}", f.Name, f.GetValue(PolarisApp.Config));
|
||||
Logger.WriteCommand(client, "[CMD] {0} = {1}", f.Name, f.GetValue(ServerApp.Config));
|
||||
break;
|
||||
|
||||
default: // Set a config option
|
||||
@ -601,13 +601,13 @@ namespace PolarisServer
|
||||
{
|
||||
var value = args[2].Contains('\"') ? full.Split('"')[1].Split('"')[0].Trim('\"') : args[2];
|
||||
|
||||
if (!PolarisApp.Config.SetField(args[1], value))
|
||||
if (!ServerApp.Config.SetField(args[1], value))
|
||||
Logger.WriteCommand(client, "[CMD] Config option {0} could not be changed to {1}", args[1],
|
||||
value);
|
||||
else
|
||||
{
|
||||
Logger.WriteCommand(client, "[CMD] Config option {0} changed to {1}", args[1], value);
|
||||
PolarisApp.Config.SettingsChanged();
|
||||
ServerApp.Config.SettingsChanged();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -644,15 +644,15 @@ namespace PolarisServer
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < PolarisApp.Instance.Server.Clients.Count; i++)
|
||||
for (var i = 0; i < ServerApp.Instance.Server.Clients.Count; i++)
|
||||
{
|
||||
if (id > -1 && i == id)
|
||||
continue;
|
||||
|
||||
// This is probably not the right way to do this
|
||||
PolarisApp.Instance.Server.Clients[i].Socket.Close();
|
||||
ServerApp.Instance.Server.Clients[i].Socket.Close();
|
||||
Logger.WriteCommand(client,
|
||||
"[CMD] Logged out user " + PolarisApp.Instance.Server.Clients[i].User.Username);
|
||||
"[CMD] Logged out user " + ServerApp.Instance.Server.Clients[i].User.Username);
|
||||
}
|
||||
|
||||
Logger.WriteCommand(client, "[CMD] Logged out all players successfully");
|
||||
@ -683,7 +683,7 @@ namespace PolarisServer
|
||||
return;
|
||||
}
|
||||
|
||||
client = PolarisApp.Instance.Server.Clients[id];
|
||||
client = ServerApp.Instance.Server.Clients[id];
|
||||
}
|
||||
|
||||
// Default coordinates
|
||||
@ -749,7 +749,7 @@ namespace PolarisServer
|
||||
}
|
||||
|
||||
// Send packet
|
||||
PolarisApp.Instance.Server.Clients[id].SendPacket(type, subType, flags, data);
|
||||
ServerApp.Instance.Server.Clients[id].SendPacket(type, subType, flags, data);
|
||||
|
||||
Logger.WriteCommand(client, "[CMD] Sent packet {0:X}-{1:X} with flags {2} to {3}", type, subType, flags,
|
||||
name);
|
||||
@ -788,7 +788,7 @@ namespace PolarisServer
|
||||
packet[index] = data[index + 8];
|
||||
|
||||
// Send packet
|
||||
PolarisApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
ServerApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
|
||||
Logger.WriteCommand(client, "[CMD] Sent contents of {0} as packet {1:X}-{2:X} with flags {3} to {4}",
|
||||
path, data[4], data[5], data[6], name);
|
||||
@ -829,7 +829,7 @@ namespace PolarisServer
|
||||
packet[index] = data[index + 8];
|
||||
|
||||
// Send packet
|
||||
PolarisApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
ServerApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
|
||||
Logger.WriteCommand(client, "[CMD] Sent contents of {0} as packet {1:X}-{2:X} with flags {3} to {4}",
|
||||
path, data[4], data[5], data[6], name);
|
||||
@ -865,7 +865,7 @@ namespace PolarisServer
|
||||
packet[index] = data[index + 8];
|
||||
|
||||
// Send packet
|
||||
PolarisApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
ServerApp.Instance.Server.Clients[id].SendPacket(data[4], data[5], data[6], packet);
|
||||
|
||||
Logger.WriteCommand(client, "[CMD] Sent contents of {0} as packet {1:X}-{2:X} with flags {3} to {4}",
|
||||
filename, data[4], data[5], data[6], name);
|
||||
@ -888,7 +888,7 @@ namespace PolarisServer
|
||||
Helper.FindPlayerByUsername(name);
|
||||
if (id != -1)
|
||||
foundPlayer = true;
|
||||
client = PolarisApp.Instance.Server.Clients[id];
|
||||
client = ServerApp.Instance.Server.Clients[id];
|
||||
}
|
||||
|
||||
|
||||
@ -924,7 +924,7 @@ namespace PolarisServer
|
||||
if (id != -1)
|
||||
foundPlayer = true;
|
||||
|
||||
client = PolarisApp.Instance.Server.Clients[id];
|
||||
client = ServerApp.Instance.Server.Clients[id];
|
||||
}
|
||||
|
||||
|
||||
@ -960,7 +960,7 @@ namespace PolarisServer
|
||||
return;
|
||||
}
|
||||
|
||||
Client context = PolarisApp.Instance.Server.Clients[id];
|
||||
Client context = ServerApp.Instance.Server.Clients[id];
|
||||
|
||||
Map dstMap = null;
|
||||
|
||||
@ -981,7 +981,7 @@ namespace PolarisServer
|
||||
//PSOLocation destination = new PSOLocation(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4]), float.Parse(args[5]),float.Parse(args[6]), float.Parse(args[7]), float.Parse(args[8]));
|
||||
|
||||
|
||||
//PolarisApp.Instance.Server.Clients[id].SendPacket(new TeleportTransferPacket(ObjectManager.Instance.getObjectByID("lobby", 443), destination));
|
||||
//ServerApp.Instance.Server.Clients[id].SendPacket(new TeleportTransferPacket(ObjectManager.Instance.getObjectByID("lobby", 443), destination));
|
||||
|
||||
context.SendPacket(0x8, 0xB, 0x0, ObjectManager.Instance.getObjectByID(443).GenerateSpawnBlob());
|
||||
|
||||
@ -1005,7 +1005,7 @@ namespace PolarisServer
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
client = PolarisApp.Instance.Server.Clients[id];
|
||||
client = ServerApp.Instance.Server.Clients[id];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1034,7 +1034,7 @@ namespace PolarisServer
|
||||
if (id == -1)
|
||||
return;
|
||||
|
||||
client = PolarisApp.Instance.Server.Clients[id];
|
||||
client = ServerApp.Instance.Server.Clients[id];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1093,7 +1093,7 @@ namespace PolarisServer
|
||||
// Logger.WriteInternal("[NPC] Adding new NPC {0} to the database for zone {1}", newNPC.NPCName, zone);
|
||||
// }
|
||||
|
||||
// using (var db = new PolarisEf())
|
||||
// using (var db = new ServerEf())
|
||||
// {
|
||||
// db.NPCs.AddRange(newNPCs);
|
||||
// db.SaveChanges();
|
||||
@ -1140,7 +1140,7 @@ namespace PolarisServer
|
||||
Logger.WriteInternal($"[NPC] Adding new NPC {npc.NPCName} to the database for zone {zone}");
|
||||
}
|
||||
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
db.NPCs.AddRange(newNPCs);
|
||||
db.SaveChanges();
|
||||
@ -1196,7 +1196,7 @@ namespace PolarisServer
|
||||
Logger.WriteInternal("[OBJ] Adding new Object {0} to the database for zone {1}", newObj.ObjectName, zone);
|
||||
}
|
||||
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
db.GameObjects.AddRange(newObjects);
|
||||
db.SaveChanges();
|
||||
|
@ -27,7 +27,7 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace PolarisServer.Crypto
|
||||
namespace PSO2SERVER.Crypto
|
||||
{
|
||||
// References:
|
||||
// a. Usenet 1994 - RC4 Algorithm revealed
|
||||
|
@ -33,7 +33,7 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace PolarisServer.Crypto
|
||||
namespace PSO2SERVER.Crypto
|
||||
{
|
||||
#if !INSIDE_CORLIB
|
||||
public
|
||||
|
@ -4,9 +4,9 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
using System.IO;
|
||||
using MySql.Data.EntityFramework;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Database
|
||||
namespace PSO2SERVER.Database
|
||||
{
|
||||
public class ServerInfo
|
||||
{
|
||||
@ -86,7 +86,7 @@ namespace PolarisServer.Database
|
||||
}
|
||||
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
public class PolarisEf : DbContext
|
||||
public class ServerEf : DbContext
|
||||
{
|
||||
public DbSet<ServerInfo> ServerInfos { get; set; }
|
||||
public DbSet<Player> Players { get; set; }
|
||||
@ -95,14 +95,14 @@ namespace PolarisServer.Database
|
||||
public DbSet<NPC> NPCs { get; set; }
|
||||
public DbSet<GameObject> GameObjects { get; set; }
|
||||
|
||||
public PolarisEf()
|
||||
public ServerEf()
|
||||
: base(
|
||||
string.Format("server={0};port={1};database={2};username={3};password={4}",
|
||||
PolarisApp.Config.DatabaseAddress,
|
||||
PolarisApp.Config.DatabasePort,
|
||||
PolarisApp.Config.DatabaseName,
|
||||
PolarisApp.Config.DatabaseUsername,
|
||||
PolarisApp.Config.DatabasePassword)
|
||||
ServerApp.Config.DatabaseAddress,
|
||||
ServerApp.Config.DatabasePort,
|
||||
ServerApp.Config.DatabaseName,
|
||||
ServerApp.Config.DatabaseUsername,
|
||||
ServerApp.Config.DatabasePassword)
|
||||
)
|
||||
{
|
||||
}
|
||||
@ -141,7 +141,7 @@ namespace PolarisServer.Database
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var context = new PolarisEf())
|
||||
using (var context = new ServerEf())
|
||||
{
|
||||
// 执行一个简单的查询来测试数据库连接
|
||||
context.Database.ExecuteSqlCommand("SELECT 1");
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public static class Helper
|
||||
{
|
||||
@ -48,8 +48,8 @@ namespace PolarisServer
|
||||
|
||||
public static int FindPlayerByUsername(string name)
|
||||
{
|
||||
for (var i = 0; i < PolarisApp.Instance.Server.Clients.Count; i++)
|
||||
if (name.ToLower() == PolarisApp.Instance.Server.Clients[i].User.Username.ToLower())
|
||||
for (var i = 0; i < ServerApp.Instance.Server.Clients.Count; i++)
|
||||
if (name.ToLower() == ServerApp.Instance.Server.Clients[i].User.Username.ToLower())
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for Console's Write and WriteLine functions to add coloring as well as integrate it into the Console System
|
||||
@ -11,16 +11,16 @@ namespace PolarisServer
|
||||
/// </summary>
|
||||
public static class Logger
|
||||
{
|
||||
private static readonly StreamWriter Writer = new StreamWriter("PolarisServer.log", true);
|
||||
private static readonly StreamWriter Writer = new StreamWriter("SERVER.log", true);
|
||||
|
||||
public static bool VerbosePackets = false;
|
||||
|
||||
private static void AddLine(ConsoleColor color, string text)
|
||||
{
|
||||
// Return if we don't have a ConsoleSystem created yet
|
||||
if (PolarisApp.ConsoleSystem == null) return;
|
||||
if (ServerApp.ConsoleSystem == null) return;
|
||||
|
||||
PolarisApp.ConsoleSystem.AddLine(color, text);
|
||||
ServerApp.ConsoleSystem.AddLine(color, text);
|
||||
}
|
||||
|
||||
public static void Write(string text, params object[] args)
|
||||
|
@ -2,10 +2,10 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
using PolarisServer.Packets;
|
||||
using PolarisServer.Database;
|
||||
using PSO2SERVER.Packets;
|
||||
using PSO2SERVER.Database;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
public class Character
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
public struct PacketHeader
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
/*
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
public enum EntityType : UInt16
|
||||
{
|
||||
|
@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Packets;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Packets;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
public class PSOObject
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public unsafe struct QuestDefiniton
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PolarisServer.Models
|
||||
namespace PSO2SERVER.Models
|
||||
{
|
||||
public enum ShipStatus : ushort
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace PolarisServer.Network
|
||||
namespace PSO2SERVER.Network
|
||||
{
|
||||
public class SocketClient
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace PolarisServer.Network
|
||||
namespace PSO2SERVER.Network
|
||||
{
|
||||
public class SocketServer
|
||||
{
|
||||
|
@ -5,10 +5,10 @@ using System.Linq;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Object
|
||||
namespace PSO2SERVER.Object
|
||||
{
|
||||
class ObjectManager
|
||||
{
|
||||
@ -39,7 +39,7 @@ namespace PolarisServer.Object
|
||||
Dictionary<ulong, PSOObject> objects = new Dictionary<ulong, PSOObject>();
|
||||
|
||||
// Collect from db
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
var dbObjects = from dbo in db.GameObjects
|
||||
where dbo.ZoneName == zone
|
||||
@ -92,7 +92,7 @@ namespace PolarisServer.Object
|
||||
internal PSONPC[] getNPCSForZone(string zone)
|
||||
{
|
||||
List<PSONPC> npcs = new List<PSONPC>();
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
var dbNpcs = from n in db.NPCs
|
||||
where n.ZoneName == zone
|
||||
|
@ -9,7 +9,7 @@
|
||||
<RootNamespace>PSO2SERVER</RootNamespace>
|
||||
<AssemblyName>PSO2SERVER</AssemblyName>
|
||||
<ReleaseVersion>0.1.0-pre</ReleaseVersion>
|
||||
<StartupObject>PolarisServer.PolarisApp</StartupObject>
|
||||
<StartupObject>PSO2SERVER.ServerApp</StartupObject>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
@ -188,7 +188,7 @@
|
||||
<Compile Include="Models\FixedPackets.cs" />
|
||||
<Compile Include="QueryServer.cs" />
|
||||
<Compile Include="Models\ShipData.cs" />
|
||||
<Compile Include="Database\PolarisEF.cs" />
|
||||
<Compile Include="Database\ServerEf.cs" />
|
||||
<Compile Include="Crypto\RC4.cs" />
|
||||
<Compile Include="Crypto\ARC4Managed.cs" />
|
||||
<Compile Include="Helper.cs" />
|
||||
|
@ -2,10 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Zone;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x3, 0x12)]
|
||||
class CampshipTeleport : PacketHandler
|
||||
|
@ -1,13 +1,13 @@
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Zone;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x3, 0x35)]
|
||||
class CasinoTeleportHandler : PacketHandler
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System.IO;
|
||||
using System.Data.Entity;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Database;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Database;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0x05)]
|
||||
public class CharacterCreate : PacketHandler
|
||||
@ -38,7 +38,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
};
|
||||
|
||||
// Add to database
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
db.Characters.Add(newCharacter);
|
||||
db.Entry(newCharacter.Player).State = EntityState.Modified;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using PolarisServer.Database;
|
||||
using PSO2SERVER.Database;
|
||||
using System.Linq;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0x02)]
|
||||
public class CharacterList : PacketHandler
|
||||
@ -15,7 +15,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
|
||||
var writer = new PacketWriter();
|
||||
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
var chars = db.Characters
|
||||
.Where(w => w.Player.PlayerId == context.User.PlayerId)
|
||||
|
@ -2,13 +2,13 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Zone;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0x3E)]
|
||||
public class CharacterSpawn : PacketHandler
|
||||
@ -29,7 +29,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
context.Character.Looks = reader.ReadStruct<Character.LooksParam>();
|
||||
context.Character.Jobs = reader.ReadStruct<Character.JobParam>();
|
||||
|
||||
using(var db = new PolarisEf())
|
||||
using(var db = new ServerEf())
|
||||
db.ChangeTracker.DetectChanges();
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x07, 0x00)]
|
||||
public class ChatHandler : PacketHandler
|
||||
@ -18,12 +18,12 @@ namespace PolarisServer.Packets.Handlers
|
||||
var channel = reader.ReadUInt32();
|
||||
var message = reader.ReadUtf16(0x9D3F, 0x44);
|
||||
|
||||
if (message.StartsWith(PolarisApp.Config.CommandPrefix))
|
||||
if (message.StartsWith(ServerApp.Config.CommandPrefix))
|
||||
{
|
||||
var valid = false;
|
||||
|
||||
// Iterate commands
|
||||
foreach (var command in PolarisApp.ConsoleSystem.Commands)
|
||||
foreach (var command in ServerApp.ConsoleSystem.Commands)
|
||||
{
|
||||
var full = message.Substring(1); // Strip the command chars
|
||||
var args = full.Split(' ');
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using PolarisServer.Crypto;
|
||||
using PSO2SERVER.Crypto;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0xB)]
|
||||
public class KeyExchange : PacketHandler
|
||||
|
@ -1,11 +1,11 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0x0)]
|
||||
public class Login : PacketHandler
|
||||
@ -28,7 +28,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
|
||||
|
||||
// What am I doing here even
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
var users = from u in db.Players
|
||||
where u.Username.ToLower().Equals(username.ToLower())
|
||||
@ -86,7 +86,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
|
||||
// Login response packet
|
||||
|
||||
context.SendPacket(new LoginDataPacket("Polaris Block 1", error, (user == null) ? (uint)0 : (uint)user.PlayerId));
|
||||
context.SendPacket(new LoginDataPacket("Server Block 1", error, (user == null) ? (uint)0 : (uint)user.PlayerId));
|
||||
|
||||
if (user == null)
|
||||
return;
|
||||
@ -100,9 +100,9 @@ namespace PolarisServer.Packets.Handlers
|
||||
|
||||
}
|
||||
|
||||
if (PolarisApp.Config.motd != "")
|
||||
if (ServerApp.Config.motd != "")
|
||||
{
|
||||
context.SendPacket(new SystemMessagePacket(PolarisApp.Config.motd, SystemMessagePacket.MessageType.AdminMessageInstant));
|
||||
context.SendPacket(new SystemMessagePacket(ServerApp.Config.motd, SystemMessagePacket.MessageType.AdminMessageInstant));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x04, 0x07)]
|
||||
public class MovementHandler : PacketHandler
|
||||
|
@ -1,13 +1,13 @@
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x4, 0x14)]
|
||||
class ObjectInteract : PacketHandler
|
||||
@ -43,7 +43,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
if (command == "Transfer" && context.CurrentZone.Name == "lobby")
|
||||
{
|
||||
// Try and get the teleport definition for the object...
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
db.Configuration.AutoDetectChangesEnabled = true;
|
||||
var teleporterEndpoint = db.Teleports.Find("lobby", (int)srcObject.ID);
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
public class PacketHandlerAttr : Attribute
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
{
|
||||
var classes = from t in Assembly.GetExecutingAssembly().GetTypes()
|
||||
where
|
||||
t.IsClass && t.Namespace == "PolarisServer.Packets.Handlers" &&
|
||||
t.IsClass && t.Namespace == "PSO2SERVER.Packets.Handlers" &&
|
||||
t.IsSubclassOf(typeof (PacketHandler))
|
||||
select t;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0xB, 0x30)]
|
||||
class QuestCounterHandler : PacketHandler
|
||||
|
@ -1,14 +1,14 @@
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Zone;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Zone;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x3, 0x34)]
|
||||
class ReturnToLobbyHandler : PacketHandler
|
||||
|
@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Database;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Database;
|
||||
|
||||
// This file is to hold all packet handlers that require no logic to respond to, or require less than 5 lines of logic.
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x03, 0x0C)]
|
||||
public class PingResponse : PacketHandler
|
||||
@ -33,7 +33,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
Logger.Write("[CHR] {0} is deleting character with ID {1}", context.User.Username, id);
|
||||
|
||||
// Delete Character
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
|
||||
foreach (var character in db.Characters)
|
||||
@ -87,7 +87,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
reader.BaseStream.Seek(0xC, SeekOrigin.Begin);
|
||||
var id = reader.ReadUInt32();
|
||||
|
||||
foreach (var client in PolarisApp.Instance.Server.Clients)
|
||||
foreach (var client in ServerApp.Instance.Server.Clients)
|
||||
{
|
||||
if (client.Character.CharacterId == id)
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PolarisServer.Party;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using PSO2SERVER.Party;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
[PacketHandlerAttr(0x11, 0x4)]
|
||||
public class StartGame : PacketHandler
|
||||
@ -19,7 +19,7 @@ namespace PolarisServer.Packets.Handlers
|
||||
|
||||
if (context.Character == null) // On character create, this is already set.
|
||||
{
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
var character = db.Characters.Find((int)charId);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets.Handlers
|
||||
namespace PSO2SERVER.Packets.Handlers
|
||||
{
|
||||
|
||||
[PacketHandlerAttr(0x2F, 0x6)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class CharacterSpawnPacket : Packet
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
internal class GuildInfoPacket : Packet
|
||||
{
|
||||
@ -47,7 +47,7 @@ namespace PolarisServer.Packets.PSOPackets
|
||||
|
||||
// Team Name
|
||||
// We don't actually have team names anywhere, just dump a test here
|
||||
writer.WriteFixedLengthUtf16("Polaris Team", 16);
|
||||
writer.WriteFixedLengthUtf16("Sancaros", 16);
|
||||
|
||||
// Unknown
|
||||
// Somewhere in here is likely a Team ID
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class LoginDataPacket : Packet
|
||||
{
|
||||
|
@ -2,10 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.Handlers;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.Handlers;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class MovementPacket : Packet
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class NoPayloadPacket : Packet
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class ObjectActionPacket : Packet
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class PalettePacket : Packet
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class PartyInitPacket : Packet
|
||||
{
|
||||
|
@ -2,10 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class QuestAvailablePacket : Packet
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class QuestDifficultyPacket : Packet
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class QuestListPacket : Packet
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class QuestStartPacket : Packet
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class SetCurrencyPacket : Packet
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class SetMesetaPacket : Packet
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class SetQuestPacket : Packet
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class SetScenePacket
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class SymbolArtList : Packet
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
public class SystemMessagePacket : Packet
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets.PSOPackets
|
||||
namespace PSO2SERVER.Packets.PSOPackets
|
||||
{
|
||||
class TeleportTransferPacket : Packet
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets
|
||||
namespace PSO2SERVER.Packets
|
||||
{
|
||||
public abstract class Packet
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Packets
|
||||
namespace PSO2SERVER.Packets
|
||||
{
|
||||
public class PacketReader : BinaryReader
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using PolarisServer.Models;
|
||||
using PSO2SERVER.Models;
|
||||
|
||||
namespace PolarisServer.Packets
|
||||
namespace PSO2SERVER.Packets
|
||||
{
|
||||
public class PacketWriter : BinaryWriter
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Party
|
||||
namespace PSO2SERVER.Party
|
||||
{
|
||||
public class Party
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace PolarisServer.Party
|
||||
namespace PSO2SERVER.Party
|
||||
{
|
||||
class PartyManager
|
||||
{
|
||||
|
@ -5,23 +5,23 @@ using System.Net;
|
||||
using System.Threading;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
using PolarisServer.Database;
|
||||
using PolarisServer.Packets.Handlers;
|
||||
using PSO2SERVER.Database;
|
||||
using PSO2SERVER.Packets.Handlers;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
internal class PolarisApp
|
||||
internal class ServerApp
|
||||
{
|
||||
public static PolarisApp Instance { get; private set; }
|
||||
public static ServerApp Instance { get; private set; }
|
||||
|
||||
// Will be using these around the app later [KeyPhact]
|
||||
public const string PolarisName = "Polaris Server";
|
||||
public const string PolarisShortName = "Polaris";
|
||||
public const string PolarisAuthor = "PolarisTeam (http://github.com/PolarisTeam)";
|
||||
public const string PolarisCopyright = "(C) 2014 PolarisTeam.";
|
||||
public const string PolarisLicense = "All licenced under AGPL.";
|
||||
public const string PolarisVersion = "v0.1.0-pre";
|
||||
public const string PolarisVersionName = "Corsac Fox";
|
||||
public const string ServerName = "Phantasy Star Online 2 Server";
|
||||
public const string ServerShortName = "PSO2";
|
||||
public const string ServerAuthor = "Sancaros (https://github.com/Sancaros/PSO2SERVER)";
|
||||
public const string ServerCopyright = "(C) 2024 Sancaros.";
|
||||
public const string ServerLicense = "All licenced under AGPL.";
|
||||
public const string ServerVersion = "v0.1.1";
|
||||
public const string ServerVersionName = "Sancaros";
|
||||
|
||||
public static IPAddress BindAddress = IPAddress.Parse("127.0.0.1");
|
||||
public static Config Config;
|
||||
@ -105,13 +105,13 @@ namespace PolarisServer
|
||||
|
||||
// Fix up startup message [KeyPhact]
|
||||
Logger.WriteHeader();
|
||||
Logger.Write(PolarisName + " - " + PolarisVersion + " (" + PolarisVersionName + ")");
|
||||
Logger.Write("By " + PolarisAuthor);
|
||||
Logger.Write(PolarisLicense);
|
||||
Logger.Write(ServerName + " - " + ServerVersion + " (" + ServerVersionName + ")");
|
||||
Logger.Write("作者 " + ServerAuthor);
|
||||
//Logger.Write(ServerLicense);
|
||||
|
||||
Thread.Sleep(1000);
|
||||
//System.Data.Entity.Database.SetInitializer(new DropCreateDatabaseIfModelChanges<PolarisEF>());
|
||||
Instance = new PolarisApp();
|
||||
//System.Data.Entity.Database.SetInitializer(new System.Data.Entity.DropCreateDatabaseIfModelChanges<ServerEf>());
|
||||
Instance = new ServerApp();
|
||||
Instance.Start();
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ namespace PolarisServer
|
||||
PacketHandlers.LoadPacketHandlers();
|
||||
|
||||
Logger.WriteInternal("[DB ] 载入数据库...");
|
||||
using (var db = new PolarisEf())
|
||||
using (var db = new ServerEf())
|
||||
{
|
||||
db.TestDatabaseConnection();
|
||||
|
||||
|
@ -6,10 +6,10 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public enum QueryMode
|
||||
{
|
||||
@ -83,7 +83,7 @@ namespace PolarisServer
|
||||
number = (uint)i,
|
||||
status = i == 2 ? ShipStatus.Online : ShipStatus.Offline, // Maybe move to Config?
|
||||
name = String.Format("Ship{0:0#}", i),
|
||||
ip = PolarisApp.BindAddress.GetAddressBytes()
|
||||
ip = ServerApp.BindAddress.GetAddressBytes()
|
||||
};
|
||||
entries.Add(entry);
|
||||
}
|
||||
@ -106,7 +106,7 @@ namespace PolarisServer
|
||||
var writer = new PacketWriter();
|
||||
writer.WriteStruct(new PacketHeader(0x90, 0x11, 0x2C, 0x0, 0x0));
|
||||
writer.Write(new byte[0x68 - 8]);
|
||||
writer.Write(PolarisApp.BindAddress.GetAddressBytes());
|
||||
writer.Write(ServerApp.BindAddress.GetAddressBytes());
|
||||
writer.Write((UInt16)12205);
|
||||
writer.Write(new byte[0x90 - 0x6A]);
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Timers;
|
||||
|
||||
using PolarisServer.Network;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Network;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
|
||||
namespace PolarisServer
|
||||
namespace PSO2SERVER
|
||||
{
|
||||
public class Server
|
||||
{
|
||||
@ -25,7 +25,7 @@ namespace PolarisServer
|
||||
Instance = this;
|
||||
StartTime = DateTime.Now;
|
||||
|
||||
PingTimer = new Timer(1000 * PolarisApp.Config.PingTime); // 1 Minute default
|
||||
PingTimer = new Timer(1000 * ServerApp.Config.PingTime); // 1 Minute default
|
||||
PingTimer.Elapsed += PingClients;
|
||||
PingTimer.Start();
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Object;
|
||||
using PolarisServer.Packets;
|
||||
using PolarisServer.Packets.PSOPackets;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Object;
|
||||
using PSO2SERVER.Packets;
|
||||
using PSO2SERVER.Packets.PSOPackets;
|
||||
|
||||
namespace PolarisServer.Zone
|
||||
namespace PSO2SERVER.Zone
|
||||
{
|
||||
public class Map
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PolarisServer.Zone
|
||||
namespace PSO2SERVER.Zone
|
||||
{
|
||||
public class ZoneManager
|
||||
{
|
||||
|
@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
|
||||
using PolarisServer.Models;
|
||||
using PolarisServer.Packets;
|
||||
using PolarisServer.Packets.Handlers;
|
||||
using PSO2SERVER.Models;
|
||||
using PSO2SERVER.Packets;
|
||||
using PSO2SERVER.Packets.Handlers;
|
||||
|
||||
namespace PolarisTests
|
||||
namespace ServerTest
|
||||
{
|
||||
[TestFixture]
|
||||
public class ReflectionTests
|
||||
|
Loading…
Reference in New Issue
Block a user