Migrated from net48 (.NET Framework) to net10.0 (cross-platform): - All 14 csproj: net48 → net10.0, WindowsDesktop SDK → Microsoft.NET.Sdk - Excluded WinForms files (Form/**, DebugControl, GameControl, etc.) - Excluded DB modules (GameDAL db/Sql/**, MrWu DB files) - Excluded server runtime files (GameBase, GlobalSever managers, GameNetModule stubs) - Added minimal stubs (GameDoStub.cs, NamespaceStubs.cs, ServerCoreStubs.cs) - Created hjha-console entry project - Fixed hardcoded Windows path → ./test/ directory - Updated global.json to SDK 10.0.109 Console test mode: PdkGameMain(null).Test() → 发牌→包庄→打牌→结算 Verified: dotnet build 0 errors, dotnet run outputs game state machine
116 lines
3.6 KiB
C#
116 lines
3.6 KiB
C#
// Minimal stubs for Linux Console mode — PdkGameDo never instantiated (DeskGameDo==null)
|
|
using Server.Pack;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Server
|
|
{
|
|
public class Desk : List<Server.Data.PlayerDataAsyc>
|
|
{
|
|
public DeskInfo deskinfo { get; set; } = new DeskInfo();
|
|
public int PlayerCnt => 0;
|
|
public void WarOver() { }
|
|
}
|
|
|
|
public class DeskInfo
|
|
{
|
|
public DeskRuleInfo rule { get; set; } = new DeskRuleInfo();
|
|
public int roomNum => 0;
|
|
}
|
|
|
|
public class DeskRuleInfo
|
|
{
|
|
public RuleExInfo RuleEx { get; set; } = new RuleExInfo();
|
|
}
|
|
|
|
public class RuleExInfo
|
|
{
|
|
public int AutoDeposit { get; set; }
|
|
public bool DepositAutoDissolve => false;
|
|
public int OutLinePenaltyPoint => 0;
|
|
}
|
|
|
|
public class Room
|
|
{
|
|
public void SaveFightData(object _) { }
|
|
}
|
|
|
|
public class LuckPlayerManager
|
|
{
|
|
public static LuckPlayerManager Instance { get; } = new LuckPlayerManager();
|
|
}
|
|
|
|
public class PropManager { }
|
|
public class GameManager { }
|
|
|
|
public static class DeskState
|
|
{
|
|
public const int Waiting = 0;
|
|
}
|
|
|
|
public static class MessageHelper
|
|
{
|
|
public static byte[] MessagePackSerialize(object _) => Array.Empty<byte>();
|
|
public static T MessagePackDeserialize<T>(byte[] _) => default;
|
|
}
|
|
|
|
public class GameDo : IGameData, IGameBehavior<GamePack>
|
|
{
|
|
public Desk desk { get; set; } = new Desk();
|
|
public IGameBehavior<GamePack> NextBehavior => null;
|
|
public bool isWar => false;
|
|
public bool isFighting { get; set; }
|
|
public GameDo() { }
|
|
public GameDo(Desk _) { }
|
|
|
|
public int GetDeskInt(int _) => 0;
|
|
public string GetDeskStr(int _) => "";
|
|
public int GetSeatId(int _) => -1;
|
|
public string GetPlayerStr(int _, int __) => "";
|
|
public int GetPlayerInt(int _, int __) => 0;
|
|
public string GetTingStr(int _) => "";
|
|
public int GetTingInt(int _) => 0;
|
|
public string GetRoomStr(int _, int __) => "";
|
|
public int GetRoomInt(int _, int __) => 0;
|
|
public string GetRoomGz() => "";
|
|
public int SetPlayer(int _, int __, int ___, string ____) => 0;
|
|
public int SaveData(byte[] _) => 0;
|
|
public void SaveHuiFang(int _, string __) { }
|
|
public int SendPack(int _, byte[] __) => 0;
|
|
public int SaveOtherData(string _) => 0;
|
|
public string LoadOtherData() => "";
|
|
public object GetTingData(string _) => null;
|
|
public object GetRoomData(int _, string __) => null;
|
|
|
|
public virtual void GameOver() { }
|
|
public virtual void StartWar() { }
|
|
public virtual void Reconnect(int _) { }
|
|
public virtual void WarOver() { }
|
|
public virtual void LoadMem(byte[] _, bool __) { }
|
|
public virtual void OutLine(int _) { }
|
|
public virtual void Quit(int _) { }
|
|
public virtual bool CanQuit(int _) => true;
|
|
public virtual void DisBank(int _ = -1) { }
|
|
public virtual void LoadMemSuccess() { }
|
|
public virtual void SecondTime() { }
|
|
public virtual void OnTime(int _) { }
|
|
public virtual void DoZyxPack(GamePack data) { }
|
|
public int GetPlayerFirstDepositSeat() => -1;
|
|
}
|
|
}
|
|
|
|
namespace Server.Data
|
|
{
|
|
public class PlayerDataAsyc
|
|
{
|
|
public bool isRobot => false;
|
|
public int ClientVer => 0;
|
|
public int seat => 0;
|
|
public bool isDePosit => false;
|
|
public bool WaitOperation { get; set; }
|
|
public int AutoDepositTime { get; set; }
|
|
public int outline { get; set; }
|
|
public void SetDeposit(bool _) { }
|
|
}
|
|
}
|