forked from sin365/AxibugEmuOnline
Compare commits
4 Commits
3c16932e0f
...
71b4bdef6b
Author | SHA1 | Date | |
---|---|---|---|
|
71b4bdef6b | ||
|
4e5fa23425 | ||
a13669dc57 | |||
c30df0b284 |
@ -1,303 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!1 &406078842955547559
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 6855144573435021451}
|
|
||||||
- component: {fileID: 4533431376032812611}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: MainMenu
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &6855144573435021451
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 406078842955547559}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 7102897325704768026}
|
|
||||||
m_Father: {fileID: 1639091784002085428}
|
|
||||||
m_RootOrder: 2
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
|
||||||
m_AnchoredPosition: {x: 282, y: -140}
|
|
||||||
m_SizeDelta: {x: -282, y: 230}
|
|
||||||
m_Pivot: {x: 0, y: 1}
|
|
||||||
--- !u!114 &4533431376032812611
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 406078842955547559}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: fb4f275956ba18440b061e92278f13cd, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_listenControlAction: 1
|
|
||||||
m_menuItemRoot: {fileID: 7102897325704768026}
|
|
||||||
GroupRoot: {fileID: 5247317738185020566}
|
|
||||||
Template: {fileID: 2502609279043838113, guid: ece591129eb9bcc48bd83ec153c98018, type: 3}
|
|
||||||
MenuSetting:
|
|
||||||
- Icon: {fileID: 21300000, guid: 1b52cdd34b39a8c4fa0dad6f2007e2f3, type: 3}
|
|
||||||
Name: Game
|
|
||||||
Description:
|
|
||||||
SubMenus: []
|
|
||||||
- Icon: {fileID: 21300000, guid: c300d49e84cf0fb4186c750320e50146, type: 3}
|
|
||||||
Name: Settings
|
|
||||||
Description:
|
|
||||||
SubMenus: []
|
|
||||||
HoriRollSpd: 1500
|
|
||||||
--- !u!1 &1639091783724093882
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1639091783724093883}
|
|
||||||
- component: {fileID: 1639091783724093861}
|
|
||||||
- component: {fileID: 1639091783724093860}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: bg
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &1639091783724093883
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1639091783724093882}
|
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 1639091784002085428}
|
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
|
||||||
--- !u!222 &1639091783724093861
|
|
||||||
CanvasRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1639091783724093882}
|
|
||||||
m_CullTransparentMesh: 1
|
|
||||||
--- !u!114 &1639091783724093860
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1639091783724093882}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_Color: {r: 0.18823531, g: 0.20392159, b: 0.45098042, a: 1}
|
|
||||||
m_RaycastTarget: 1
|
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
m_Maskable: 1
|
|
||||||
m_OnCullStateChanged:
|
|
||||||
m_PersistentCalls:
|
|
||||||
m_Calls: []
|
|
||||||
m_Sprite: {fileID: 0}
|
|
||||||
m_Type: 0
|
|
||||||
m_PreserveAspect: 0
|
|
||||||
m_FillCenter: 1
|
|
||||||
m_FillMethod: 4
|
|
||||||
m_FillAmount: 1
|
|
||||||
m_FillClockwise: 1
|
|
||||||
m_FillOrigin: 0
|
|
||||||
m_UseSpriteMesh: 0
|
|
||||||
m_PixelsPerUnitMultiplier: 1
|
|
||||||
--- !u!1 &1639091784002085451
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1639091784002085428}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: LanchUI
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &1639091784002085428
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1639091784002085451}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 1639091783724093883}
|
|
||||||
- {fileID: 2355022013370943017}
|
|
||||||
- {fileID: 6855144573435021451}
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
|
||||||
--- !u!1 &2556464728420224707
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 2355022013370943017}
|
|
||||||
- component: {fileID: 4512092057495325491}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: CommandDispatcher
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &2355022013370943017
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2556464728420224707}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 1639091784002085428}
|
|
||||||
m_RootOrder: 1
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
|
||||||
--- !u!114 &4512092057495325491
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2556464728420224707}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 4471d8231d16ba3469228e09d4cb3a81, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!1 &3732356966700017678
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 7102897325704768026}
|
|
||||||
- component: {fileID: 5247317738185020566}
|
|
||||||
- component: {fileID: 7796917812299756373}
|
|
||||||
m_Layer: 5
|
|
||||||
m_Name: MenuBtnGroup
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!224 &7102897325704768026
|
|
||||||
RectTransform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 3732356966700017678}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 6855144573435021451}
|
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
|
||||||
m_Pivot: {x: 0, y: 0.5}
|
|
||||||
--- !u!114 &5247317738185020566
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 3732356966700017678}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_Padding:
|
|
||||||
m_Left: 0
|
|
||||||
m_Right: 0
|
|
||||||
m_Top: 0
|
|
||||||
m_Bottom: 0
|
|
||||||
m_ChildAlignment: 3
|
|
||||||
m_Spacing: 80
|
|
||||||
m_ChildForceExpandWidth: 0
|
|
||||||
m_ChildForceExpandHeight: 0
|
|
||||||
m_ChildControlWidth: 1
|
|
||||||
m_ChildControlHeight: 1
|
|
||||||
m_ChildScaleWidth: 1
|
|
||||||
m_ChildScaleHeight: 1
|
|
||||||
m_ReverseArrangement: 0
|
|
||||||
--- !u!114 &7796917812299756373
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 3732356966700017678}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_HorizontalFit: 2
|
|
||||||
m_VerticalFit: 2
|
|
2708
AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab
Normal file
2708
AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/LaunchUI.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -283,7 +283,9 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ed40f0945dba47e409627739ce124125, type: 3}
|
m_Script: {fileID: 11500000, guid: ed40f0945dba47e409627739ce124125, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_listenControlAction: 1
|
PulseInvoke_Delay: 0.4
|
||||||
|
PulseInvoke_Interval: 0.05
|
||||||
|
m_listenControlAction: 0
|
||||||
m_menuItemRoot: {fileID: 3226730524206505336}
|
m_menuItemRoot: {fileID: 3226730524206505336}
|
||||||
SubMenuItemTemplate: {fileID: 2502609279043838113, guid: 01f3c5497992f944eae9b9efa15a19c2, type: 3}
|
SubMenuItemTemplate: {fileID: 2502609279043838113, guid: 01f3c5497992f944eae9b9efa15a19c2, type: 3}
|
||||||
alphaGroup: {fileID: 6355204462360987243}
|
alphaGroup: {fileID: 6355204462360987243}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
if (wrapTex == null)
|
if (wrapTex == null)
|
||||||
{
|
{
|
||||||
wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false);
|
//wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false);
|
||||||
|
wrapTex = new Texture2D(272, 240, TextureFormat.RGBA32, false);
|
||||||
wrapTex.filterMode = FilterMode.Point;
|
wrapTex.filterMode = FilterMode.Point;
|
||||||
wrapTexBuffer = screenData;
|
wrapTexBuffer = screenData;
|
||||||
|
|
||||||
@ -36,7 +37,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
TexBufferSize = wrapTexBuffer.Length * 4;
|
TexBufferSize = wrapTexBuffer.Length * 4;
|
||||||
|
|
||||||
var palRaw = PaletteDefine.m_cnPalette[0];
|
var palRaw = PaletteDefine.m_cnPalette[0];
|
||||||
pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true);
|
//pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true);
|
||||||
|
pPal = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false);
|
||||||
pPal.filterMode = FilterMode.Point;
|
pPal.filterMode = FilterMode.Point;
|
||||||
for (int i = 0; i < palRaw.Length; i++)
|
for (int i = 0; i < palRaw.Length; i++)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,8 @@
|
|||||||
|
|
||||||
half4 color = tex2D(_MainTex,mapUV);
|
half4 color = tex2D(_MainTex,mapUV);
|
||||||
|
|
||||||
float rawIndex = color.b;
|
//float rawIndex = color.b;
|
||||||
|
float rawIndex = color.r;
|
||||||
|
|
||||||
color = tex2D(_PalTex,float2(rawIndex,0.5));
|
color = tex2D(_PalTex,float2(rawIndex,0.5));
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
public static CommandDispatcher Instance { get; private set; }
|
public static CommandDispatcher Instance { get; private set; }
|
||||||
|
|
||||||
HashSet<MenuItemController> m_register = new HashSet<MenuItemController>();
|
List<MenuItemController> m_register = new List<MenuItemController>();
|
||||||
Dictionary<KeyCode, MenuItemController.EnumCommand> m_keyMapper = new Dictionary<KeyCode, MenuItemController.EnumCommand>();
|
Dictionary<KeyCode, MenuItemController.EnumCommand> m_keyMapper = new Dictionary<KeyCode, MenuItemController.EnumCommand>();
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
@ -40,6 +40,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
public void RegistController(MenuItemController controller)
|
public void RegistController(MenuItemController controller)
|
||||||
{
|
{
|
||||||
|
if (m_register.Contains(controller)) { return; }
|
||||||
|
|
||||||
m_register.Add(controller);
|
m_register.Add(controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,13 +56,19 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
if (Input.GetKeyDown(item.Key))
|
if (Input.GetKeyDown(item.Key))
|
||||||
{
|
{
|
||||||
foreach (var controller in m_register)
|
for (int i = 0; i < m_register.Count; i++)
|
||||||
|
{
|
||||||
|
var controller = m_register[i];
|
||||||
controller.ExecuteCommand(item.Value, false);
|
controller.ExecuteCommand(item.Value, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Input.GetKeyUp(item.Key))
|
if (Input.GetKeyUp(item.Key))
|
||||||
{
|
{
|
||||||
foreach (var controller in m_register)
|
for (int i = 0; i < m_register.Count; i++)
|
||||||
|
{
|
||||||
|
var controller = m_register[i];
|
||||||
controller.ExecuteCommand(item.Value, true);
|
controller.ExecuteCommand(item.Value, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
71
AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs
Normal file
71
AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
using AxibugEmuOnline.Client.UI;
|
||||||
|
using DG.Tweening;
|
||||||
|
using DG.Tweening.Core;
|
||||||
|
using DG.Tweening.Plugins.Options;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AxibugEmuOnline.Client
|
||||||
|
{
|
||||||
|
public class LaunchUI : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
RectTransform MainMenuRoot;
|
||||||
|
[SerializeField]
|
||||||
|
MainMenuController MainMenu;
|
||||||
|
|
||||||
|
Vector2 m_mainLayoutPosition;
|
||||||
|
[SerializeField]
|
||||||
|
Vector2 m_detailLayoutPosition;
|
||||||
|
[SerializeField]
|
||||||
|
float m_LayoutChangeSpeed = 10;
|
||||||
|
|
||||||
|
public static LaunchUI Instance { get; private set; }
|
||||||
|
|
||||||
|
TweenerCore<Vector2, Vector2, VectorOptions> m_layoutTween;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
m_mainLayoutPosition = MainMenuRoot.anchoredPosition;
|
||||||
|
MainMenu.ListenControlAction = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ToDetailMenuLayout()
|
||||||
|
{
|
||||||
|
if (m_layoutTween != null)
|
||||||
|
{
|
||||||
|
m_layoutTween.Kill();
|
||||||
|
m_layoutTween = null;
|
||||||
|
}
|
||||||
|
m_layoutTween = DOTween
|
||||||
|
.To(
|
||||||
|
() => MainMenuRoot.anchoredPosition,
|
||||||
|
(x) => MainMenuRoot.anchoredPosition = x,
|
||||||
|
m_detailLayoutPosition,
|
||||||
|
m_LayoutChangeSpeed)
|
||||||
|
.SetSpeedBased();
|
||||||
|
MainMenu.ListenControlAction = false;
|
||||||
|
MainMenu.EnterDetailState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToMainMenuLayout()
|
||||||
|
{
|
||||||
|
if (m_layoutTween != null)
|
||||||
|
{
|
||||||
|
m_layoutTween.Kill();
|
||||||
|
m_layoutTween = null;
|
||||||
|
}
|
||||||
|
m_layoutTween = DOTween.To(
|
||||||
|
() => MainMenuRoot.anchoredPosition,
|
||||||
|
(x) => MainMenuRoot.anchoredPosition = x,
|
||||||
|
m_mainLayoutPosition,
|
||||||
|
m_LayoutChangeSpeed)
|
||||||
|
.SetSpeedBased();
|
||||||
|
MainMenu.ListenControlAction = true;
|
||||||
|
MainMenu.ExitDetailState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs.meta
Normal file
11
AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fa6d08b067172d648a400aab72f1b4cc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -3,12 +3,14 @@ using DG.Tweening.Core;
|
|||||||
using DG.Tweening.Plugins.Options;
|
using DG.Tweening.Plugins.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using static GluonGui.WorkspaceWindow.Views.Checkin.Operations.CheckinViewDeleteOperation;
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Client.UI
|
namespace AxibugEmuOnline.Client.UI
|
||||||
{
|
{
|
||||||
public class MainMenu : MenuItemController
|
public class MainMenuController : MenuItemController
|
||||||
{
|
{
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
HorizontalLayoutGroup GroupRoot;
|
HorizontalLayoutGroup GroupRoot;
|
||||||
@ -22,6 +24,61 @@ namespace AxibugEmuOnline.Client.UI
|
|||||||
private RectTransform groupRootRect => m_menuItemRoot as RectTransform;
|
private RectTransform groupRootRect => m_menuItemRoot as RectTransform;
|
||||||
|
|
||||||
private TweenerCore<Vector2, Vector2, VectorOptions> rollTween;
|
private TweenerCore<Vector2, Vector2, VectorOptions> rollTween;
|
||||||
|
private List<CanvasGroup> m_runtimeMenuUICanvas;
|
||||||
|
private Sequence seq;
|
||||||
|
|
||||||
|
protected override void Start()
|
||||||
|
{
|
||||||
|
base.Start();
|
||||||
|
|
||||||
|
m_runtimeMenuUICanvas = m_runtimeMenuUI.Select(menu => menu.gameObject.AddComponent<CanvasGroup>()).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void EnterDetailState()
|
||||||
|
{
|
||||||
|
if (seq != null)
|
||||||
|
{
|
||||||
|
seq.Kill();
|
||||||
|
seq = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectItem = m_runtimeMenuUICanvas[SelectIndex];
|
||||||
|
var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList();
|
||||||
|
seq = DOTween.Sequence();
|
||||||
|
|
||||||
|
seq.Append(
|
||||||
|
DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f)
|
||||||
|
)
|
||||||
|
.Join(
|
||||||
|
DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 0, 0.2f)
|
||||||
|
);
|
||||||
|
|
||||||
|
seq.Play();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ExitDetailState()
|
||||||
|
{
|
||||||
|
if (seq != null)
|
||||||
|
{
|
||||||
|
seq.Kill();
|
||||||
|
seq = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectItem = m_runtimeMenuUICanvas[SelectIndex];
|
||||||
|
var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList();
|
||||||
|
seq = DOTween.Sequence();
|
||||||
|
|
||||||
|
seq.Append(
|
||||||
|
DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f)
|
||||||
|
)
|
||||||
|
.Join(
|
||||||
|
DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 1, 0.2f)
|
||||||
|
);
|
||||||
|
|
||||||
|
seq.Play();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnSelectMenuChanged()
|
protected override void OnSelectMenuChanged()
|
||||||
{
|
{
|
||||||
@ -34,19 +91,18 @@ namespace AxibugEmuOnline.Client.UI
|
|||||||
|
|
||||||
if (rollTween != null) { rollTween.Kill(); rollTween = null; }
|
if (rollTween != null) { rollTween.Kill(); rollTween = null; }
|
||||||
|
|
||||||
|
for (var i = 0; i < m_runtimeMenuUI.Count; i++)
|
||||||
|
{
|
||||||
|
var item = m_runtimeMenuUI[i];
|
||||||
|
item.SetSelectState(i == SelectIndex);
|
||||||
|
}
|
||||||
|
|
||||||
rollTween = DOTween.To(
|
rollTween = DOTween.To(
|
||||||
() => groupRootRect.anchoredPosition,
|
() => groupRootRect.anchoredPosition,
|
||||||
(x) => groupRootRect.anchoredPosition = x,
|
(x) => groupRootRect.anchoredPosition = x,
|
||||||
targetPosition,
|
targetPosition,
|
||||||
HoriRollSpd)
|
HoriRollSpd)
|
||||||
.SetSpeedBased().OnUpdate(() =>
|
.SetSpeedBased();
|
||||||
{
|
|
||||||
for (var i = 0; i < m_runtimeMenuUI.Count; i++)
|
|
||||||
{
|
|
||||||
var item = m_runtimeMenuUI[i];
|
|
||||||
item.SetSelectState(i == SelectIndex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCmdSelectItemLeft()
|
protected override void OnCmdSelectItemLeft()
|
@ -1,11 +1,9 @@
|
|||||||
using Coffee.UIExtensions;
|
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using DG.Tweening.Core;
|
using DG.Tweening.Core;
|
||||||
using DG.Tweening.Plugins.Options;
|
using DG.Tweening.Plugins.Options;
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using static Codice.Client.BaseCommands.Import.Commit;
|
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Client.UI
|
namespace AxibugEmuOnline.Client.UI
|
||||||
{
|
{
|
||||||
@ -29,6 +27,7 @@ namespace AxibugEmuOnline.Client.UI
|
|||||||
|
|
||||||
public RectTransform Rect => transform as RectTransform;
|
public RectTransform Rect => transform as RectTransform;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
private bool m_select;
|
private bool m_select;
|
||||||
private TweenerCore<float, float, FloatOptions> progressTween;
|
private TweenerCore<float, float, FloatOptions> progressTween;
|
||||||
public float m_progress;
|
public float m_progress;
|
||||||
@ -54,6 +53,7 @@ namespace AxibugEmuOnline.Client.UI
|
|||||||
|
|
||||||
public void SetData(MenuData data)
|
public void SetData(MenuData data)
|
||||||
{
|
{
|
||||||
|
name = data.Name;
|
||||||
Icon.sprite = data.Icon;
|
Icon.sprite = data.Icon;
|
||||||
|
|
||||||
if (ShadowIcon != null) ShadowIcon.sprite = data.Icon;
|
if (ShadowIcon != null) ShadowIcon.sprite = data.Icon;
|
||||||
@ -96,5 +96,10 @@ namespace AxibugEmuOnline.Client.UI
|
|||||||
public void OnEnterItem()
|
public void OnEnterItem()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnExitItem()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
float PulseInvoke_Delay = 0.4f;
|
float PulseInvoke_Delay = 0.4f;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
float PulseInvoke_Interval = 0.05f;
|
float PulseInvoke_Interval = 0.05f;
|
||||||
|
|
||||||
[SerializeField]
|
|
||||||
private bool m_listenControlAction;
|
private bool m_listenControlAction;
|
||||||
public bool ListenControlAction
|
public bool ListenControlAction
|
||||||
{
|
{
|
||||||
@ -33,7 +32,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
private PulseInvoker m_pulsInvoker_Up;
|
private PulseInvoker m_pulsInvoker_Up;
|
||||||
private PulseInvoker m_pulsInvoker_Down;
|
private PulseInvoker m_pulsInvoker_Down;
|
||||||
|
|
||||||
private int m_selectIndex;
|
private int m_selectIndex = -1;
|
||||||
protected List<MenuItem> m_runtimeMenuUI = new List<MenuItem>();
|
protected List<MenuItem> m_runtimeMenuUI = new List<MenuItem>();
|
||||||
|
|
||||||
public int SelectIndex
|
public int SelectIndex
|
||||||
@ -42,6 +41,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
value = Mathf.Clamp(value, 0, m_runtimeMenuUI.Count - 1);
|
value = Mathf.Clamp(value, 0, m_runtimeMenuUI.Count - 1);
|
||||||
|
if (m_selectIndex == value) return;
|
||||||
m_selectIndex = value;
|
m_selectIndex = value;
|
||||||
|
|
||||||
OnSelectMenuChanged();
|
OnSelectMenuChanged();
|
||||||
@ -62,11 +62,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
Canvas.ForceUpdateCanvases();
|
Canvas.ForceUpdateCanvases();
|
||||||
SelectIndex = 0;
|
SelectIndex = 0;
|
||||||
|
|
||||||
if (m_listenControlAction)
|
|
||||||
{
|
|
||||||
CommandDispatcher.Instance.RegistController(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pulsInvoker_Left = new PulseInvoker(OnCmdSelectItemLeft, PulseInvoke_Delay, PulseInvoke_Interval);
|
m_pulsInvoker_Left = new PulseInvoker(OnCmdSelectItemLeft, PulseInvoke_Delay, PulseInvoke_Interval);
|
||||||
m_pulsInvoker_Right = new PulseInvoker(OnCmdSelectItemRight, PulseInvoke_Delay, PulseInvoke_Interval);
|
m_pulsInvoker_Right = new PulseInvoker(OnCmdSelectItemRight, PulseInvoke_Delay, PulseInvoke_Interval);
|
||||||
m_pulsInvoker_Up = new PulseInvoker(OnCmdSelectItemUp, PulseInvoke_Delay, PulseInvoke_Interval);
|
m_pulsInvoker_Up = new PulseInvoker(OnCmdSelectItemUp, PulseInvoke_Delay, PulseInvoke_Interval);
|
||||||
@ -75,7 +70,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
CommandDispatcher.Instance.UnRegistController(this);
|
if (CommandDispatcher.Instance != null)
|
||||||
|
CommandDispatcher.Instance.UnRegistController(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Update()
|
protected virtual void Update()
|
||||||
@ -88,8 +84,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
protected abstract void OnSelectMenuChanged();
|
protected abstract void OnSelectMenuChanged();
|
||||||
|
|
||||||
|
MenuItem m_enteredItem = null;
|
||||||
|
|
||||||
public void ExecuteCommand(EnumCommand cmd, bool cancel)
|
public void ExecuteCommand(EnumCommand cmd, bool cancel)
|
||||||
{
|
{
|
||||||
if (!cancel)
|
if (!cancel)
|
||||||
@ -97,23 +92,52 @@ namespace AxibugEmuOnline.Client
|
|||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case EnumCommand.SelectItemLeft:
|
case EnumCommand.SelectItemLeft:
|
||||||
m_pulsInvoker_Left.SetActive();
|
if (m_enteredItem == null)
|
||||||
OnCmdSelectItemLeft(); break;
|
{
|
||||||
|
m_pulsInvoker_Left.SetActive();
|
||||||
|
OnCmdSelectItemLeft();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EnumCommand.SelectItemRight:
|
case EnumCommand.SelectItemRight:
|
||||||
m_pulsInvoker_Right.SetActive();
|
if (m_enteredItem == null)
|
||||||
OnCmdSelectItemRight(); break;
|
{
|
||||||
|
m_pulsInvoker_Right.SetActive();
|
||||||
|
OnCmdSelectItemRight();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EnumCommand.SelectItemUp:
|
case EnumCommand.SelectItemUp:
|
||||||
m_pulsInvoker_Up.SetActive();
|
if (m_enteredItem == null)
|
||||||
OnCmdSelectItemUp(); break;
|
{
|
||||||
|
m_pulsInvoker_Up.SetActive();
|
||||||
|
OnCmdSelectItemUp();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EnumCommand.SelectItemDown:
|
case EnumCommand.SelectItemDown:
|
||||||
m_pulsInvoker_Down.SetActive();
|
if (m_enteredItem == null)
|
||||||
OnCmdSelectItemDown(); break;
|
{
|
||||||
|
m_pulsInvoker_Down.SetActive();
|
||||||
|
OnCmdSelectItemDown();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EnumCommand.Enter:
|
case EnumCommand.Enter:
|
||||||
var item = m_runtimeMenuUI[SelectIndex];
|
if (m_enteredItem == null)
|
||||||
OnCmdEnter(item);
|
{
|
||||||
|
m_enteredItem = m_runtimeMenuUI[SelectIndex];
|
||||||
|
OnCmdEnter(m_enteredItem);
|
||||||
|
|
||||||
|
m_pulsInvoker_Left.DisActive();
|
||||||
|
m_pulsInvoker_Right.DisActive();
|
||||||
|
m_pulsInvoker_Up.DisActive();
|
||||||
|
m_pulsInvoker_Down.DisActive();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EnumCommand.Back:
|
case EnumCommand.Back:
|
||||||
OnCmdBack(); break;
|
if (m_enteredItem != null)
|
||||||
|
{
|
||||||
|
OnCmdBack(m_enteredItem);
|
||||||
|
m_enteredItem = null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case EnumCommand.OptionMenu:
|
case EnumCommand.OptionMenu:
|
||||||
OnCmdOptionMenu();
|
OnCmdOptionMenu();
|
||||||
break;
|
break;
|
||||||
@ -145,7 +169,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
protected virtual void OnCmdOptionMenu() { }
|
protected virtual void OnCmdOptionMenu() { }
|
||||||
protected virtual void OnCmdEnter(MenuItem item) { item.OnEnterItem(); }
|
protected virtual void OnCmdEnter(MenuItem item) { item.OnEnterItem(); }
|
||||||
protected virtual void OnCmdBack() { }
|
protected virtual void OnCmdBack(MenuItem item) { item.OnExitItem(); }
|
||||||
public enum EnumCommand
|
public enum EnumCommand
|
||||||
{
|
{
|
||||||
SelectItemLeft,
|
SelectItemLeft,
|
||||||
|
@ -59,6 +59,20 @@ namespace AxibugEmuOnline.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnCmdEnter(MenuItem item)
|
||||||
|
{
|
||||||
|
LaunchUI.Instance.ToDetailMenuLayout();
|
||||||
|
item.SetSelectState(false);
|
||||||
|
base.OnCmdEnter(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnCmdBack(MenuItem item)
|
||||||
|
{
|
||||||
|
LaunchUI.Instance.ToMainMenuLayout();
|
||||||
|
item.SetSelectState(true);
|
||||||
|
base.OnCmdBack(item);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnCmdSelectItemUp()
|
protected override void OnCmdSelectItemUp()
|
||||||
{
|
{
|
||||||
SelectIndex--;
|
SelectIndex--;
|
||||||
@ -101,6 +115,13 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
calcItemPosition();
|
calcItemPosition();
|
||||||
|
|
||||||
|
for (var i = 0; i < m_runtimeMenuUI.Count; i++)
|
||||||
|
{
|
||||||
|
var item = m_runtimeMenuUI[i];
|
||||||
|
bool isSelectItem = i == SelectIndex;
|
||||||
|
item.SetSelectState(isSelectItem);
|
||||||
|
}
|
||||||
|
|
||||||
rollTween = DOTween.To(() => 1, (x) => { }, 1, duration).OnUpdate(() =>
|
rollTween = DOTween.To(() => 1, (x) => { }, 1, duration).OnUpdate(() =>
|
||||||
{
|
{
|
||||||
var tweenProgress = rollTween.position / rollTween.Duration();
|
var tweenProgress = rollTween.position / rollTween.Duration();
|
||||||
@ -109,8 +130,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
var item = m_runtimeMenuUI[i];
|
var item = m_runtimeMenuUI[i];
|
||||||
var needPos = m_itemUIPosition[i];
|
var needPos = m_itemUIPosition[i];
|
||||||
item.Rect.anchoredPosition = Vector2.Lerp(item.Rect.anchoredPosition, needPos, tweenProgress);
|
item.Rect.anchoredPosition = Vector2.Lerp(item.Rect.anchoredPosition, needPos, tweenProgress);
|
||||||
bool isSelectItem = i == SelectIndex;
|
|
||||||
item.SetSelectState(isSelectItem);
|
|
||||||
}
|
}
|
||||||
}).OnComplete(() =>
|
}).OnComplete(() =>
|
||||||
{
|
{
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Google.Protobuf">
|
<Reference Include="Google.Protobuf">
|
||||||
<HintPath>..\..\Lib\Google.Protobuf.dll</HintPath>
|
<HintPath>..\Lib\Google.Protobuf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HaoYueNet.ServerNetwork">
|
<Reference Include="HaoYueNet.ServerNetwork">
|
||||||
<HintPath>..\..\Lib\HaoYueNet.ServerNetwork.dll</HintPath>
|
<HintPath>..\Lib\HaoYueNet.ServerNetwork.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
public static class AppSrv
|
public static class AppSrv
|
||||||
{
|
{
|
||||||
|
public static TickManager g_Tick;
|
||||||
public static ClientManager g_ClientMgr;
|
public static ClientManager g_ClientMgr;
|
||||||
public static LogManager g_Log;
|
public static LogManager g_Log;
|
||||||
public static LoginManager g_Login;
|
public static LoginManager g_Login;
|
||||||
@ -17,6 +18,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
public static void InitServer(int port)
|
public static void InitServer(int port)
|
||||||
{
|
{
|
||||||
|
g_Tick = new TickManager();
|
||||||
g_ClientMgr = new ClientManager();
|
g_ClientMgr = new ClientManager();
|
||||||
g_ClientMgr.Init(45000, 120);
|
g_ClientMgr.Init(45000, 120);
|
||||||
g_Log = new LogManager();
|
g_Log = new LogManager();
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
using AxibugProtobuf;
|
using AxibugEmuOnline.Server.Common;
|
||||||
|
using AxibugEmuOnline.Server.NetWork;
|
||||||
|
using AxibugProtobuf;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
|
||||||
@ -12,8 +14,34 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
public Socket _socket { get; set; }
|
public Socket _socket { get; set; }
|
||||||
public bool IsOffline { get; set; } = false;
|
public bool IsOffline { get; set; } = false;
|
||||||
public DateTime LogOutDT { get; set; }
|
public DateTime LogOutDT { get; set; }
|
||||||
|
public DateTime LogInDT { get; set; }
|
||||||
|
public UserRoomState RoomState { get; set; } = new UserRoomState();
|
||||||
|
|
||||||
|
public TimeSpan LastStartPingTime { get; set; }
|
||||||
|
public int LastPingSeed { get; set; }
|
||||||
|
public double NetDelay { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserRoomState
|
||||||
|
{
|
||||||
|
public int RoomID { get; private set; }
|
||||||
|
public int PlayerIdx { get; private set; }
|
||||||
|
public UserRoomState()
|
||||||
|
{
|
||||||
|
ClearRoomData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRoomData(int roomID,int playerIdx)
|
||||||
|
{
|
||||||
|
RoomID = roomID;
|
||||||
|
PlayerIdx = playerIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearRoomData()
|
||||||
|
{
|
||||||
|
RoomID = -1;
|
||||||
|
PlayerIdx = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ClientManager
|
public class ClientManager
|
||||||
@ -23,8 +51,10 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
private Dictionary<long?, ClientInfo> _DictUIDClient = new Dictionary<long?, ClientInfo>();
|
private Dictionary<long?, ClientInfo> _DictUIDClient = new Dictionary<long?, ClientInfo>();
|
||||||
private long TestUIDSeed = 0;
|
private long TestUIDSeed = 0;
|
||||||
|
|
||||||
private System.Timers.Timer _ClientCheckTimer;
|
private System.Timers.Timer clientCheckTimer;
|
||||||
|
private AutoResetEvent pingTickARE;
|
||||||
private long _RemoveOfflineCacheMin;
|
private long _RemoveOfflineCacheMin;
|
||||||
|
private Thread threadPingTick;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化并指定检查时间
|
/// 初始化并指定检查时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -32,13 +62,22 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
/// <param name="RemoveOfflineCache">清理掉线分钟数</param>
|
/// <param name="RemoveOfflineCache">清理掉线分钟数</param>
|
||||||
public void Init(long ticktime, long RemoveOfflineCacheMin)
|
public void Init(long ticktime, long RemoveOfflineCacheMin)
|
||||||
{
|
{
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdPing, OnCmdPing);
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdPong, OnCmdPong);
|
||||||
|
|
||||||
|
pingTickARE = AppSrv.g_Tick.AddNewARE(TickManager.TickType.Interval_2000MS);
|
||||||
|
|
||||||
//换算成毫秒
|
//换算成毫秒
|
||||||
_RemoveOfflineCacheMin = RemoveOfflineCacheMin;
|
_RemoveOfflineCacheMin = RemoveOfflineCacheMin;
|
||||||
_ClientCheckTimer = new System.Timers.Timer();
|
clientCheckTimer = new System.Timers.Timer();
|
||||||
_ClientCheckTimer.Interval = ticktime;
|
clientCheckTimer.Interval = ticktime;
|
||||||
_ClientCheckTimer.AutoReset = true;
|
clientCheckTimer.AutoReset = true;
|
||||||
_ClientCheckTimer.Elapsed += new ElapsedEventHandler(ClientCheckClearOffline_Elapsed);
|
clientCheckTimer.Elapsed += new ElapsedEventHandler(ClientCheckClearOffline_Elapsed);
|
||||||
_ClientCheckTimer.Enabled = true;
|
clientCheckTimer.Enabled = true;
|
||||||
|
|
||||||
|
pingTickARE = AppSrv.g_Tick.AddNewARE(TickManager.TickType.Interval_2000MS);
|
||||||
|
threadPingTick = new Thread(PingAllLoop);
|
||||||
|
threadPingTick.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetNextUID()
|
public long GetNextUID()
|
||||||
@ -192,11 +231,75 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Ping
|
||||||
|
void PingAllLoop()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
pingTickARE.WaitOne();
|
||||||
|
AppSrv.g_Log.Info("PingAll");
|
||||||
|
PingAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void PingAll()
|
||||||
|
{
|
||||||
|
List<ClientInfo> clientlist = GetOnlineClientList();
|
||||||
|
int randSeed = new Random().Next(0, int.MaxValue);
|
||||||
|
foreach (var _c in clientlist)
|
||||||
|
{
|
||||||
|
_c.LastPingSeed = randSeed;
|
||||||
|
_c.LastStartPingTime = AppSrv.g_Tick.sw.Elapsed;
|
||||||
|
|
||||||
|
Protobuf_Ping resp = new Protobuf_Ping()
|
||||||
|
{
|
||||||
|
Seed = randSeed,
|
||||||
|
};
|
||||||
|
AppSrv.g_ClientMgr.ClientSend(_c._socket, (int)CommandID.CmdPing, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnCmdPing(Socket sk, byte[] reqData)
|
||||||
|
{
|
||||||
|
AppSrv.g_Log.Debug($"OnCmdPing");
|
||||||
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(sk);
|
||||||
|
Protobuf_Ping msg = ProtoBufHelper.DeSerizlize<Protobuf_Ping>(reqData);
|
||||||
|
|
||||||
|
//创建成功下行
|
||||||
|
Protobuf_Pong resp = new Protobuf_Pong()
|
||||||
|
{
|
||||||
|
Seed = msg.Seed,
|
||||||
|
};
|
||||||
|
AppSrv.g_ClientMgr.ClientSend(_c._socket, (int)CommandID.CmdPong, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
|
}
|
||||||
|
public void OnCmdPong(Socket sk, byte[] reqData)
|
||||||
|
{
|
||||||
|
AppSrv.g_Log.Debug($"OnCmdPong");
|
||||||
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(sk);
|
||||||
|
Protobuf_Pong msg = ProtoBufHelper.DeSerizlize<Protobuf_Pong>(reqData);
|
||||||
|
|
||||||
|
if (_c.LastPingSeed == msg.Seed)
|
||||||
|
{
|
||||||
|
TimeSpan current = AppSrv.g_Tick.sw.Elapsed;
|
||||||
|
TimeSpan delta = current - _c.LastStartPingTime;
|
||||||
|
_c.NetDelay = delta.TotalSeconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public void ClientSendALL(int CMDID, int ERRCODE, byte[] data, long SkipUID = -1)
|
public void ClientSendALL(int CMDID, int ERRCODE, byte[] data, long SkipUID = -1)
|
||||||
{
|
{
|
||||||
ClientSend(ClientList, CMDID, ERRCODE, data, SkipUID);
|
ClientSend(ClientList, CMDID, ERRCODE, data, SkipUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClientSend(List<long> UIDs,int CMDID, int ERRCODE, byte[] data, long SkipUID = -1)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < UIDs.Count(); i++)
|
||||||
|
{
|
||||||
|
if (!GetClientByUID(UIDs[i], out ClientInfo _c, true))
|
||||||
|
continue;
|
||||||
|
AppSrv.g_SocketMgr.SendToSocket(_c._socket, CMDID, ERRCODE, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 给一组用户发送数据
|
/// 给一组用户发送数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using AxibugEmuOnline.Server.Manager;
|
using AxibugEmuOnline.Server.Manager;
|
||||||
using AxibugEmuOnline.Server.NetWork;
|
using AxibugEmuOnline.Server.NetWork;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Server
|
namespace AxibugEmuOnline.Server
|
||||||
|
@ -26,7 +26,6 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
Token = "",
|
Token = "",
|
||||||
UID = cinfo.UID
|
UID = cinfo.UID
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,10 @@
|
|||||||
using AxibugEmuOnline.Server.Manager;
|
using AxibugEmuOnline.Server.Manager;
|
||||||
using AxibugEmuOnline.Server.NetWork;
|
using AxibugEmuOnline.Server.NetWork;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using System.Net;
|
using System;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Server
|
namespace AxibugEmuOnline.Server
|
||||||
{
|
{
|
||||||
@ -12,14 +13,22 @@ namespace AxibugEmuOnline.Server
|
|||||||
public class RoomManager
|
public class RoomManager
|
||||||
{
|
{
|
||||||
Dictionary<int, Data_RoomData> mDictRoom = new Dictionary<int, Data_RoomData>();
|
Dictionary<int, Data_RoomData> mDictRoom = new Dictionary<int, Data_RoomData>();
|
||||||
|
List<int> mKeyRoomList = new List<int>();
|
||||||
|
AutoResetEvent roomTickARE;
|
||||||
|
Thread threadRoomTick;
|
||||||
|
|
||||||
int RoomIDSeed = 1;
|
int RoomIDSeed = 1;
|
||||||
public RoomManager()
|
public RoomManager()
|
||||||
{
|
{
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomList, OnCmdRoomList);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomList, OnCmdRoomList);
|
||||||
|
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomCreate, OnCmdRoomCreate);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomCreate, OnCmdRoomCreate);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomJoin, OnCmdRoomJoin);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomJoin, OnCmdRoomJoin);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomLeave, OnCmdRoomLeave);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomLeave, OnCmdRoomLeave);
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomSingelPlayerInput, OnSingelPlayerInput);
|
||||||
|
|
||||||
|
roomTickARE = AppSrv.g_Tick.AddNewARE(TickManager.TickType.Interval_16MS);
|
||||||
|
threadRoomTick = new Thread(UpdateLoopTick);
|
||||||
|
threadRoomTick.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 房间管理
|
#region 房间管理
|
||||||
@ -31,32 +40,33 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
void AddRoom(Data_RoomData data)
|
void AddRoom(Data_RoomData data)
|
||||||
{
|
{
|
||||||
lock (mDictRoom)
|
lock (mDictRoom)
|
||||||
{
|
{
|
||||||
if (!mDictRoom.ContainsKey(data.RoomID))
|
if (!mDictRoom.ContainsKey(data.RoomID))
|
||||||
{
|
{
|
||||||
mDictRoom.Add(data.RoomID, data);
|
mDictRoom.Add(data.RoomID, data);
|
||||||
|
mKeyRoomList.Remove(data.RoomID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveRoom(int RoomID)
|
void RemoveRoom(int RoomID)
|
||||||
{
|
{
|
||||||
lock(mDictRoom)
|
lock (mDictRoom)
|
||||||
{
|
{
|
||||||
if (mDictRoom.ContainsKey(RoomID))
|
if (mDictRoom.ContainsKey(RoomID))
|
||||||
{
|
{
|
||||||
mDictRoom.Remove(RoomID);
|
mDictRoom.Remove(RoomID);
|
||||||
|
mKeyRoomList.Remove(RoomID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Data_RoomData GetRoomData(int RoomID)
|
public Data_RoomData GetRoomData(int RoomID)
|
||||||
{
|
{
|
||||||
if (!mDictRoom.ContainsKey(RoomID))
|
if (!mDictRoom.TryGetValue(RoomID,out Data_RoomData data))
|
||||||
return null;
|
return null;
|
||||||
|
return data;
|
||||||
return mDictRoom[RoomID];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Data_RoomData> GetRoomList()
|
List<Data_RoomData> GetRoomList()
|
||||||
@ -105,7 +115,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
Protobuf_Room_List_RESP resp = new Protobuf_Room_List_RESP();
|
Protobuf_Room_List_RESP resp = new Protobuf_Room_List_RESP();
|
||||||
List<Data_RoomData> temp = GetRoomList();
|
List<Data_RoomData> temp = GetRoomList();
|
||||||
foreach (var room in temp)
|
foreach (var room in temp)
|
||||||
resp.RoomMiniInfoList.Add(GetProtoDataRoom(room));
|
resp.RoomMiniInfoList.Add(GetProtoDataRoom(room));
|
||||||
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdChatmsg, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdChatmsg, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
}
|
}
|
||||||
@ -115,7 +125,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="RoomID"></param>
|
/// <param name="RoomID"></param>
|
||||||
/// <param name="type">//[0] 更新或新增 [1] 删除</param>
|
/// <param name="type">//[0] 更新或新增 [1] 删除</param>
|
||||||
public void SendRoomUpdateToAll(int RoomID,int type)
|
public void SendRoomUpdateToAll(int RoomID, int type)
|
||||||
{
|
{
|
||||||
Data_RoomData room = GetRoomData(RoomID);
|
Data_RoomData room = GetRoomData(RoomID);
|
||||||
if (room == null)
|
if (room == null)
|
||||||
@ -129,7 +139,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
AppSrv.g_ClientMgr.ClientSendALL((int)CommandID.CmdRoomListUpdate, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
AppSrv.g_ClientMgr.ClientSendALL((int)CommandID.CmdRoomListUpdate, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnCmdRoomCreate(Socket sk, byte[] reqData)
|
public void OnCmdRoomCreate(Socket sk, byte[] reqData)
|
||||||
{
|
{
|
||||||
AppSrv.g_Log.Debug($"OnCmdRoomCreate ");
|
AppSrv.g_Log.Debug($"OnCmdRoomCreate ");
|
||||||
@ -137,7 +147,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
Protobuf_Room_Create msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Create>(reqData);
|
Protobuf_Room_Create msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Create>(reqData);
|
||||||
|
|
||||||
Data_RoomData newRoom = new Data_RoomData();
|
Data_RoomData newRoom = new Data_RoomData();
|
||||||
newRoom.Init(GetNewRoomID(), msg.GameRomID,msg.GameRomHash);
|
newRoom.Init(GetNewRoomID(), msg.GameRomID, msg.GameRomHash);
|
||||||
AddRoom(newRoom);
|
AddRoom(newRoom);
|
||||||
|
|
||||||
|
|
||||||
@ -203,6 +213,16 @@ namespace AxibugEmuOnline.Server
|
|||||||
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomLeave, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomLeave, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
Protobuf_Room_MyRoom_State_Change(msg.RoomID);
|
Protobuf_Room_MyRoom_State_Change(msg.RoomID);
|
||||||
}
|
}
|
||||||
|
public void OnSingelPlayerInput(Socket sk, byte[] reqData)
|
||||||
|
{
|
||||||
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(sk);
|
||||||
|
Protobuf_Room_SinglePlayerInputData msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_SinglePlayerInputData>(reqData);
|
||||||
|
|
||||||
|
Data_RoomData room = GetRoomData(_c.RoomState.RoomID);
|
||||||
|
if (room == null)
|
||||||
|
return;
|
||||||
|
room.SetPlayerInput(_c.RoomState.PlayerIdx, msg.FrameID, (ushort)msg.InputData);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 广播房间状态变化
|
/// 广播房间状态变化
|
||||||
@ -221,9 +241,9 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
List<ClientInfo> userlist = room.GetAllPlayerClientList();
|
List<ClientInfo> userlist = room.GetAllPlayerClientList();
|
||||||
|
|
||||||
foreach(ClientInfo _c in userlist)
|
foreach (ClientInfo _c in userlist)
|
||||||
{
|
{
|
||||||
AppSrv.g_ClientMgr.ClientSend(_c,(int)CommandID.CmdRoomMyRoomStateChanged, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdRoomMyRoomStateChanged, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +256,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
/// <param name="_c"></param>
|
/// <param name="_c"></param>
|
||||||
/// <param name="errcode"></param>
|
/// <param name="errcode"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
bool Join(int RoomID,int PlayerNum,ClientInfo _c,out ErrorCode errcode)
|
bool Join(int RoomID, int PlayerNum, ClientInfo _c, out ErrorCode errcode)
|
||||||
{
|
{
|
||||||
Data_RoomData room = GetRoomData(RoomID);
|
Data_RoomData room = GetRoomData(RoomID);
|
||||||
if (room == null)
|
if (room == null)
|
||||||
@ -252,7 +272,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
errcode = ErrorCode.ErrorRoomSlotReadlyHadPlayer;
|
errcode = ErrorCode.ErrorRoomSlotReadlyHadPlayer;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
room.Player1_UID = _c.UID;
|
room.SetPlayerUID(0,_c);
|
||||||
}
|
}
|
||||||
//其他玩家
|
//其他玩家
|
||||||
else
|
else
|
||||||
@ -262,7 +282,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
errcode = ErrorCode.ErrorRoomSlotReadlyHadPlayer;
|
errcode = ErrorCode.ErrorRoomSlotReadlyHadPlayer;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
room.Player2_UID = _c.UID;
|
room.SetPlayerUID(1, _c);
|
||||||
}
|
}
|
||||||
|
|
||||||
//广播房间
|
//广播房间
|
||||||
@ -287,10 +307,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.Player1_UID == _c.UID)
|
room.RemovePlayer(_c);
|
||||||
room.Player1_UID = -1;
|
|
||||||
if (room.Player2_UID == _c.UID)
|
|
||||||
room.Player2_UID = -1;
|
|
||||||
|
|
||||||
if (room.PlayerState == RoomPlayerState.NonePlayerState)
|
if (room.PlayerState == RoomPlayerState.NonePlayerState)
|
||||||
{
|
{
|
||||||
@ -306,26 +323,108 @@ namespace AxibugEmuOnline.Server
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 房间帧循环
|
||||||
|
void UpdateLoopTick()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
roomTickARE.WaitOne();
|
||||||
|
UpdateAllRoomLogic();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void UpdateAllRoomLogic()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < mKeyRoomList.Count; i++)
|
||||||
|
{
|
||||||
|
int roomid = mKeyRoomList[i];
|
||||||
|
if (!mDictRoom.TryGetValue(roomid,out Data_RoomData room))
|
||||||
|
continue;
|
||||||
|
if (room.GameState > RoomGameState.InGame)
|
||||||
|
continue;
|
||||||
|
//更新帧
|
||||||
|
room.TakeFrame();
|
||||||
|
//广播
|
||||||
|
room.SynInputData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Data_RoomData
|
public class Data_RoomData
|
||||||
{
|
{
|
||||||
public int RoomID;
|
public int RoomID { get; private set; }
|
||||||
public int GameRomID;
|
public int GameRomID { get; private set; }
|
||||||
public string RomHash;
|
public string RomHash { get; private set; }
|
||||||
public long Player1_UID;
|
public bool bNeedLoadState { get; private set; }
|
||||||
public long Player2_UID;
|
public int LoadStateFrame { get; private set; }
|
||||||
|
public Google.Protobuf.ByteString LoadStateRaw { get; set; }
|
||||||
|
public long Player1_UID { get; private set; }
|
||||||
|
public long Player2_UID { get; private set; }
|
||||||
|
public long Player3_UID { get; private set; }
|
||||||
|
public long Player4_UID { get; private set; }
|
||||||
|
public bool[] PlayerReadyState { get; private set; }
|
||||||
|
public List<long> SynUIDs;
|
||||||
public RoomPlayerState PlayerState => getPlayerState();
|
public RoomPlayerState PlayerState => getPlayerState();
|
||||||
public RoomGameState GameState;
|
public RoomGameState GameState;
|
||||||
|
public uint mCurrFrameId = 0;
|
||||||
|
public ServerInputSnapShot mCurrInputData;
|
||||||
|
public Queue<(uint, ServerInputSnapShot)> mInputQueue;
|
||||||
|
//TODO
|
||||||
|
public Dictionary<int, Queue<byte[]>> mDictPlayerIdx2SendQueue;
|
||||||
|
|
||||||
public void Init(int roomID,int gameRomID,string roomHash)
|
public void Init(int roomID, int gameRomID, string roomHash, bool bloadState = false)
|
||||||
{
|
{
|
||||||
RoomID = roomID;
|
RoomID = roomID;
|
||||||
GameRomID = gameRomID;
|
GameRomID = gameRomID;
|
||||||
RomHash = roomHash;
|
RomHash = roomHash;
|
||||||
Player1_UID = -1;
|
Player1_UID = -1;
|
||||||
Player2_UID = -1;
|
Player2_UID = -1;
|
||||||
|
Player3_UID = -1;
|
||||||
|
Player4_UID = -1;
|
||||||
|
SynUIDs = new List<long>();//广播角色列表
|
||||||
GameState = RoomGameState.NoneGameState;
|
GameState = RoomGameState.NoneGameState;
|
||||||
|
mCurrInputData = new ServerInputSnapShot();
|
||||||
|
mInputQueue = new Queue<(uint, ServerInputSnapShot)>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPlayerUID(int PlayerIdx,ClientInfo _c)
|
||||||
|
{
|
||||||
|
long oldUID = -1;
|
||||||
|
switch (PlayerIdx)
|
||||||
|
{
|
||||||
|
case 0: oldUID = Player1_UID; Player1_UID = _c.UID; break;
|
||||||
|
case 1: oldUID = Player2_UID; Player2_UID = _c.UID; break;
|
||||||
|
case 2: oldUID = Player3_UID; Player3_UID = _c.UID; break;
|
||||||
|
case 3: oldUID = Player4_UID; Player4_UID = _c.UID; break;
|
||||||
|
}
|
||||||
|
if(oldUID <= 0)
|
||||||
|
SynUIDs.Remove(oldUID);
|
||||||
|
SynUIDs.Add(_c.UID);
|
||||||
|
_c.RoomState.SetRoomData(this.RoomID, PlayerIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemovePlayer(ClientInfo _c)
|
||||||
|
{
|
||||||
|
int PlayerIdx = GetPlayerIdx(_c);
|
||||||
|
switch (PlayerIdx)
|
||||||
|
{
|
||||||
|
case 0: Player1_UID = -1; SynUIDs.Remove(_c.UID);break;
|
||||||
|
case 1: Player2_UID = -1; SynUIDs.Remove(_c.UID);break;
|
||||||
|
case 2: Player3_UID = -1; SynUIDs.Remove(_c.UID);break;
|
||||||
|
case 3: Player4_UID = -1; SynUIDs.Remove(_c.UID);break;
|
||||||
|
}
|
||||||
|
_c.RoomState.ClearRoomData();
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetPlayerIdx(ClientInfo _c)
|
||||||
|
{
|
||||||
|
if (Player1_UID == _c.UID) return 0;
|
||||||
|
if (Player2_UID == _c.UID) return 1;
|
||||||
|
if (Player3_UID == _c.UID) return 2;
|
||||||
|
if (Player4_UID == _c.UID) return 3;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomPlayerState getPlayerState()
|
RoomPlayerState getPlayerState()
|
||||||
@ -358,7 +457,7 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
foreach (long uid in Uids)
|
foreach (long uid in Uids)
|
||||||
{
|
{
|
||||||
if (!AppSrv.g_ClientMgr.GetClientByUID(uid, out ClientInfo _c,true))
|
if (!AppSrv.g_ClientMgr.GetClientByUID(uid, out ClientInfo _c, true))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
list.Add(_c);
|
list.Add(_c);
|
||||||
@ -366,5 +465,65 @@ namespace AxibugEmuOnline.Server
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetPlayerInput(int PlayerIdx,long mFrameID,ushort input)
|
||||||
|
{
|
||||||
|
switch (PlayerIdx)
|
||||||
|
{
|
||||||
|
case 0: mCurrInputData.p1 = input; break;
|
||||||
|
case 1: mCurrInputData.p2 = input; break;
|
||||||
|
case 2: mCurrInputData.p3 = input; break;
|
||||||
|
case 3: mCurrInputData.p4 = input; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearPlayerInput(int PlayerIdx)
|
||||||
|
{
|
||||||
|
switch (PlayerIdx)
|
||||||
|
{
|
||||||
|
case 0: mCurrInputData.p1 = 0; break;
|
||||||
|
case 1: mCurrInputData.p2 = 0; break;
|
||||||
|
case 2: mCurrInputData.p3 = 0; break;
|
||||||
|
case 3: mCurrInputData.p4 = 0; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TakeFrame()
|
||||||
|
{
|
||||||
|
mInputQueue.Enqueue((mCurrFrameId, mCurrInputData));
|
||||||
|
mCurrFrameId++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 广播数据
|
||||||
|
/// </summary>
|
||||||
|
public void SynInputData()
|
||||||
|
{
|
||||||
|
while (mInputQueue.Count > 0)
|
||||||
|
{
|
||||||
|
(uint frameId, ServerInputSnapShot inputdata) data = mInputQueue.Dequeue();
|
||||||
|
Protobuf_Room_Syn_RoomFrameAllInput resp = new Protobuf_Room_Syn_RoomFrameAllInput()
|
||||||
|
{
|
||||||
|
FrameID = data.frameId,
|
||||||
|
InputData = data.inputdata.all
|
||||||
|
};
|
||||||
|
AppSrv.g_ClientMgr.ClientSendALL((int)CommandID.CmdRoomSyn, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(resp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Explicit)]
|
||||||
|
public struct ServerInputSnapShot
|
||||||
|
{
|
||||||
|
[FieldOffset(0)]
|
||||||
|
public UInt64 all;
|
||||||
|
[FieldOffset(0)]
|
||||||
|
public ushort p1;
|
||||||
|
[FieldOffset(2)]
|
||||||
|
public ushort p2;
|
||||||
|
[FieldOffset(4)]
|
||||||
|
public ushort p3;
|
||||||
|
[FieldOffset(6)]
|
||||||
|
public ushort p4;
|
||||||
}
|
}
|
||||||
}
|
}
|
72
AxibugEmuOnline.Server/Manager/TickManager.cs
Normal file
72
AxibugEmuOnline.Server/Manager/TickManager.cs
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace AxibugEmuOnline.Server.Manager
|
||||||
|
{
|
||||||
|
public class TickManager
|
||||||
|
{
|
||||||
|
public Stopwatch sw;
|
||||||
|
public enum TickType
|
||||||
|
{
|
||||||
|
Interval_16MS,
|
||||||
|
Interval_32MS,
|
||||||
|
Interval_2000MS,
|
||||||
|
}
|
||||||
|
|
||||||
|
System.Timers.Timer mTimer16ms;
|
||||||
|
System.Timers.Timer mTimer32ms;
|
||||||
|
System.Timers.Timer mTimer2000ms;
|
||||||
|
List<AutoResetEvent> mAREList16ms;
|
||||||
|
List<AutoResetEvent> mAREList32ms;
|
||||||
|
List<AutoResetEvent> mAREList2000ms;
|
||||||
|
|
||||||
|
public TickManager()
|
||||||
|
{
|
||||||
|
sw = Stopwatch.StartNew();
|
||||||
|
mAREList16ms = new List<AutoResetEvent>();
|
||||||
|
mAREList32ms = new List<AutoResetEvent>();
|
||||||
|
mAREList2000ms = new List<AutoResetEvent>();
|
||||||
|
|
||||||
|
mTimer16ms = new System.Timers.Timer(16);//实例化Timer类,设置间隔时间为10000毫秒;
|
||||||
|
mTimer16ms.Elapsed += new System.Timers.ElapsedEventHandler((source, e) => { UpdateARE(mAREList16ms); });//到达时间的时候执行事件;
|
||||||
|
mTimer16ms.AutoReset = true;//设置是执行一次(false)还是一直执行(true);
|
||||||
|
mTimer16ms.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件;
|
||||||
|
mTimer16ms.Start();
|
||||||
|
|
||||||
|
mTimer32ms = new System.Timers.Timer(32);//实例化Timer类,设置间隔时间为10000毫秒;
|
||||||
|
mTimer32ms.Elapsed += new System.Timers.ElapsedEventHandler((source, e) => { UpdateARE(mAREList32ms); });//到达时间的时候执行事件;
|
||||||
|
mTimer32ms.AutoReset = true;//设置是执行一次(false)还是一直执行(true);
|
||||||
|
mTimer32ms.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件;
|
||||||
|
mTimer32ms.Start();
|
||||||
|
|
||||||
|
mTimer2000ms = new System.Timers.Timer(2000);//实例化Timer类,设置间隔时间为10000毫秒;
|
||||||
|
mTimer2000ms.Elapsed += new System.Timers.ElapsedEventHandler((source, e) => { UpdateARE(mAREList2000ms); });//到达时间的时候执行事件;
|
||||||
|
mTimer2000ms.AutoReset = true;//设置是执行一次(false)还是一直执行(true);
|
||||||
|
mTimer2000ms.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件;
|
||||||
|
mTimer2000ms.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AutoResetEvent AddNewARE(TickType tikeType)
|
||||||
|
{
|
||||||
|
AutoResetEvent are = new AutoResetEvent(false);
|
||||||
|
switch (tikeType)
|
||||||
|
{
|
||||||
|
case TickType.Interval_16MS:
|
||||||
|
mAREList16ms.Add(are);
|
||||||
|
break;
|
||||||
|
case TickType.Interval_32MS:
|
||||||
|
mAREList32ms.Add(are);
|
||||||
|
break;
|
||||||
|
case TickType.Interval_2000MS:
|
||||||
|
mAREList2000ms.Add(are);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return are;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateARE(List<AutoResetEvent> are)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < are.Count; i++)
|
||||||
|
are[i].Set();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -12,5 +12,5 @@ for /f "delims=" %%i in ('dir /b proto "proto/*.proto"') do (
|
|||||||
echo "==>>build finish"
|
echo "==>>build finish"
|
||||||
echo "==>>copy cs"
|
echo "==>>copy cs"
|
||||||
|
|
||||||
copy %cd%\out\CS\ ..\AxibugEmuOnline.Server\AxibugEmuOnline.Server\Protobuf
|
copy %cd%\out\CS\ ..\AxibugEmuOnline.Server\Protobuf
|
||||||
pause
|
pause
|
File diff suppressed because it is too large
Load Diff
@ -6,26 +6,54 @@ enum CommandID
|
|||||||
{
|
{
|
||||||
CMD_DEFAUL = 0;//缺省不使用
|
CMD_DEFAUL = 0;//缺省不使用
|
||||||
|
|
||||||
|
//服务器或客户端,均可主动ping请求,对方响应。(这里测全流程延迟,即序 列化->发送->传输过程->接收->反序列化)
|
||||||
|
CMD_PING = 1; //Ping | 请求 对应 Protobuf_Ping
|
||||||
|
CMD_PONG = 2; //Pong | 响应 对应 Protobuf_Pong
|
||||||
|
|
||||||
CMD_LOGIN = 2001; //自动登录上行 | 下行 对应 Protobuf_Login | Protobuf_Login_RESP
|
CMD_LOGIN = 2001; //自动登录上行 | 下行 对应 Protobuf_Login | Protobuf_Login_RESP
|
||||||
|
|
||||||
CMD_CHATMSG = 4001; //广播聊天信息上行 | 下行 对应 Protobuf_ChatMsg | Protobuf_ChatMsg_RESP
|
CMD_CHATMSG = 4001; //广播聊天信息上行 | 下行 对应 Protobuf_ChatMsg | Protobuf_ChatMsg_RESP
|
||||||
|
|
||||||
//房间列表相关
|
//房间列表相关(仅用于列表显示)
|
||||||
CMD_Room_List = 5001; //房间列表 上行 | 下行 对应 Protobuf_Room_List | Protobuf_Room_List_RESP
|
CMD_Room_List = 5001; //房间列表 上行 | 下行 对应 Protobuf_Room_List | Protobuf_Room_List_RESP
|
||||||
|
|
||||||
CMD_Room_List_Update = 5002; //房间单个房间信息更新 对应 Protobuf_Room_Update_RESP
|
CMD_Room_List_Update = 5002; //房间单个房间信息更新 对应 Protobuf_Room_Update_RESP
|
||||||
|
|
||||||
//房间内相关
|
//房间内相关
|
||||||
CMD_Room_Create = 5101; //房间列表创建 对应 Protobuf_Room_Create | Protobuf_Room_Create_RESP
|
CMD_Room_Create = 5101; //房间创建 对应 Protobuf_Room_Create | Protobuf_Room_Create_RESP
|
||||||
|
CMD_Room_Join = 5105; //房间加入 对应 Protobuf_Room_Join | Protobuf_Room_Join_RESP
|
||||||
|
CMD_Room_Leave = 5106; //房间离开 对应 Protobuf_Room_Leave | Protobuf_Room_Leave_RESP
|
||||||
|
CMD_Room_MyRoom_State_Changed = 5110; //我所在的房间内状态发生变化 对应 Protobuf_Room_MyRoom_State_Change
|
||||||
|
|
||||||
CMD_Room_Join = 5105; //房间列表加入 对应 Protobuf_Room_Join | Protobuf_Room_Join_RESP
|
//准备和开始流程(5201 ~ 5204 ~ 5208)
|
||||||
|
//
|
||||||
CMD_Room_Leave = 5106; //房间列表离开 对应 Protobuf_Room_Leave | Protobuf_Room_Leave_RESP
|
// 我们采用,玩家可以随时进入的方式开发
|
||||||
|
//
|
||||||
CMD_Room_MyRoom_State_Changed = 5110; //我所在的房间内状态发生变化 对应 Protobuf_Room_MyRoom_State_Change;
|
// 设计流程:
|
||||||
|
//
|
||||||
|
// Step0:服务器广播"等待-主机上报即使存档" CMD_Room_WaitStep WaitStep=[0] ---> 客户端:暂停模拟器核心:全员等待(主机玩家一人上传即时存档)
|
||||||
|
// 主机玩家 上行 CMD_Room_HostPlayer_UpdateStateRaw消息,上传即时存档
|
||||||
|
// 主机玩家上传完毕之后,服务器会通知进入Step1
|
||||||
|
//
|
||||||
|
// Step1:服务器广播"等待-全员加载即时存档" CMD_Room_WaitStep WaitStep=[1] 附带即时存档 ---> 客户端:全员等待(主机玩家一人上传)
|
||||||
|
// 所有玩家确保加载ROM和即时存档,并保持模拟器暂停,准备完毕后 发送 CMD_Room_Player_Ready
|
||||||
|
// 所有玩家Ready之后,服务器会根据所有玩家延迟提前跑若干Frame,通知进入Step2
|
||||||
|
//
|
||||||
|
// Step2:服务器广播"开始" CMD_Room_WaitStep WaitStep=[2] ---> 客户端:立即开始
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// PS:[联机过程中加载即时存档] 房间在游玩过程中,单个玩家发送CMD_Room_HostPlayer_UpdateStateRaw 上报即时存档
|
||||||
|
// 重新从Step1走流程
|
||||||
|
//
|
||||||
|
CMD_Room_WaitStep = 5201; //服务器等待Step通知 下行 Protobuf_Room_WaitStep_RESP
|
||||||
|
CMD_Room_HostPlayer_UpdateStateRaw = 5204; //服务器房间准备和开始标识 下行 Protobuf_Room_HostPlayer_UpdateStateRaw
|
||||||
|
CMD_Room_Player_Ready = 5208; //玩家准备完毕 上行 Protobuf_Room_Player_Ready
|
||||||
|
|
||||||
//游戏同步
|
//游戏同步
|
||||||
CMD_Screen = 6001; //画面同步 | 同步广播 对应 Protobuf_Screnn_Frame
|
CMD_Room_Singel_PlayerInput = 6010; //单个玩家操作同步上行 对应 Protobuf_Room_SinglePlayerInputData
|
||||||
|
CMD_ROOM_SYN = 6015; //单个玩家操作同步上行 对应 Protobuf_Room_Syn_RoomFrameAllInput
|
||||||
|
|
||||||
|
//画面采集
|
||||||
|
CMD_Screen = 7001; //画面采集 | 同步广播 对应 Protobuf_Screnn_Frame
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ErrorCode
|
enum ErrorCode
|
||||||
@ -62,8 +90,12 @@ enum RoomPlayerState
|
|||||||
enum RoomGameState
|
enum RoomGameState
|
||||||
{
|
{
|
||||||
None_GameState = 0;//缺省
|
None_GameState = 0;//缺省
|
||||||
InGame = 1;//游戏中
|
OnlyHost = 1;//仅主机,待加入
|
||||||
Pause = 2;//暂停
|
ReadyStep_0 = 2;//ReadyStep0
|
||||||
|
ReadyStep_1 = 3;//ReadyStep1
|
||||||
|
ReadyStep_2 = 4;//ReadyStep2
|
||||||
|
Pause = 5;//暂停
|
||||||
|
InGame = 6;//游戏中
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -88,6 +120,15 @@ message Protobuf_ChatMsg_RESP
|
|||||||
int64 Date = 3;//时间
|
int64 Date = 3;//时间
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Protobuf_Ping
|
||||||
|
{
|
||||||
|
int32 Seed = 1;//随机数
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Pong
|
||||||
|
{
|
||||||
|
int32 Seed = 1;//原样返回随机数
|
||||||
|
}
|
||||||
|
|
||||||
//登录数据上行
|
//登录数据上行
|
||||||
message Protobuf_Login
|
message Protobuf_Login
|
||||||
@ -101,14 +142,14 @@ message Protobuf_Login
|
|||||||
//登录数据下行
|
//登录数据下行
|
||||||
message Protobuf_Login_RESP
|
message Protobuf_Login_RESP
|
||||||
{
|
{
|
||||||
string Token = 1;//登录凭据 (本次登录之后,所有业务请求凭据,需要存储在内存中)
|
string DeviceUUID = 1;//设备唯一串
|
||||||
string LastLoginDate = 2;//上次登录时间(只用于呈现的字符串,若界面需求需要)
|
string Token = 2;//登录凭据 (本次登录之后,所有业务请求凭据,需要存储在内存中)
|
||||||
string RegDate = 3;//注册时间(只用于呈现的字符串,若界面需求需要)
|
string LastLoginDate = 3;//上次登录时间(只用于呈现的字符串,若界面需求需要)
|
||||||
LoginResultStatus Status = 4;//账号状态 (预留) [1]正常[0]被禁封
|
string RegDate = 4;//注册时间(只用于呈现的字符串,若界面需求需要)
|
||||||
int64 UID = 5;
|
LoginResultStatus Status = 5;//账号状态 (预留) [1]正常[0]被禁封
|
||||||
|
int64 UID = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message Protobuf_Room_List
|
message Protobuf_Room_List
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -146,6 +187,18 @@ message Protobuf_Screnn_Frame
|
|||||||
bytes RawBitmap = 3;//渲染层画面
|
bytes RawBitmap = 3;//渲染层画面
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Protobuf_Room_SinglePlayerInputData
|
||||||
|
{
|
||||||
|
uint32 FrameID = 1;//帧编号
|
||||||
|
uint32 InputData = 2;//单个玩家操作位运算汇总
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Room_Syn_RoomFrameAllInput
|
||||||
|
{
|
||||||
|
uint32 FrameID = 1;//帧编号
|
||||||
|
uint64 InputData = 2;//所有玩家操作位运算汇总
|
||||||
|
}
|
||||||
|
|
||||||
message Protobuf_Room_Create
|
message Protobuf_Room_Create
|
||||||
{
|
{
|
||||||
int32 GameRomID = 1;
|
int32 GameRomID = 1;
|
||||||
@ -181,4 +234,20 @@ message Protobuf_Room_Leave_RESP
|
|||||||
message Protobuf_Room_MyRoom_State_Change
|
message Protobuf_Room_MyRoom_State_Change
|
||||||
{
|
{
|
||||||
Protobuf_Room_MiniInfo RoomMiniInfo = 1;//更新房间信息
|
Protobuf_Room_MiniInfo RoomMiniInfo = 1;//更新房间信息
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message Protobuf_Room_WaitStep_RESP
|
||||||
|
{
|
||||||
|
int32 WaitStep = 1;//状态 [0]等待主机上报即时存档 [1]要求准备 [2]开始(收到本状态时,立即开始跑模拟器核心)
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Room_HostPlayer_UpdateStateRaw
|
||||||
|
{
|
||||||
|
int32 ReadyFrame = 1;//要求准备的帧数 (非即时存档则为0)
|
||||||
|
bytes LoadStateRaw = 2;//即时存档byte数据
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Room_Player_Ready
|
||||||
|
{
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user