PSVita输入框索尼lib,房间更换槽位接口,服务端Room fixed

This commit is contained in:
sin365 2024-12-25 18:09:40 +08:00
parent 4c42b40199
commit 4792b7da98
16 changed files with 601 additions and 4 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 957996f7ef8e16e4d83eace2efbcbfaa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 338f56c77fdd1c6498ba8b57baadd618
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
fileFormatVersion: 2
guid: 255d4b97366fc9e429c8cf1a54ee47b8
timeCreated: 1499268372
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
PSP2: PSP2
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,253 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 1
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 1
m_BakeResolution: 50
m_AtlasSize: 1024
m_AO: 1
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 0
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 4890085278179872738, guid: 134c351b3dc8395478a02c168bed5e72, type: 2}
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666666
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &718010440
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 718010445}
- component: {fileID: 718010444}
- component: {fileID: 718010442}
- component: {fileID: 718010441}
- component: {fileID: 718010448}
- component: {fileID: 718010446}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &718010441
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
m_Enabled: 1
--- !u!124 &718010442
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
m_Enabled: 1
--- !u!20 &718010444
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 100
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &718010445
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
serializedVersion: 2
m_LocalRotation: {x: 0.13219804, y: 0, z: 0, w: 0.99122334}
m_LocalPosition: {x: 0, y: 3, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &718010446
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7bc72e9d59cc9134d8855521049ad788, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &718010448
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 718010440}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f451418d53ab95442b9cd42f836f7553, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 718010445}

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 75a40431d8fb8324b92629c82f271192
DefaultImporter:
userData:

View File

@ -0,0 +1,211 @@
Unity SCE Common Dialog Example Project.
This example project demonstrates how to use the Unity SCE Common Dialog API for displaying and retrieving results from user, system, progress, error and text entry (IME) dialogs.
Project Folder Structure
Plugins/PSVita - Contains the CommonDialog native plugin.
SonyAssemblies - Contains the SonyVitaCommonDialog managed interface to the CommonDialog plugin.
SonyExample/CommonDialog - Contains a Unity scene which runs the scripts.
SonyExample/CommonDialog/Scripts - Contains the Sony NP example scripts.
SonyExample/Utils - Contains various utility scripts for use by the example.
The SonyVitaCommonDialog managed assembly defines the following namespaces...
Sony.Vita.Dialog.Main Contains methods for initialising and updating the plugin.
Sony.Vita.Dialog.Common Contains methods for working with the SCE Common Dialog for user, system, progress, and error messages.
Sony.Vita.Dialog.Common.Ime Contains methods for working with the SCE IME Dialog for text entry.
Sony.Vita.Dialog.Main
Methods.
public static void Initialise()
Initialises the plugin, call once.
public static void Update()
Updates the plugin, call once each frame.
Sony.Vita.Dialog.Common
Enumerations.
System message dialog types, these are a one-one match with the values defined by SceMsgDialogSystemMessageType.
public enum EnumSystemMessageType
{
MSG_DIALOG_SYSMSG_TYPE_WAIT = 1,
MSG_DIALOG_SYSMSG_TYPE_NOSPACE = 2,
MSG_DIALOG_SYSMSG_TYPE_MAGNETIC_CALIBRATION = 3,
MSG_DIALOG_SYSMSG_TYPE_WAIT_SMALL = 5,
MSG_DIALOG_SYSMSG_TYPE_WAIT_CANCEL = 6,
MSG_DIALOG_SYSMSG_TYPE_NOSPACE_CONTINUABLE = 9,
MSG_DIALOG_SYSMSG_TYPE_LOCATION_DATA_OBTAINING = 10,
MSG_DIALOG_SYSMSG_TYPE_LOCATION_DATA_FAILURE = 11,
MSG_DIALOG_SYSMSG_TYPE_LOCATION_DATA_FAILURE_RETRY = 12,
MSG_DIALOG_SYSMSG_TYPE_PATCH_FOUND = 13,
}
User message dialog types, these are a one-one match with the values defined by SceMsgDialogButtonType.
public enum EnumUserMessageType
{
MSG_DIALOG_BUTTON_TYPE_OK = 0,
MSG_DIALOG_BUTTON_TYPE_YESNO = 1,
MSG_DIALOG_BUTTON_TYPE_NONE = 2,
MSG_DIALOG_BUTTON_TYPE_OK_CANCEL = 3,
MSG_DIALOG_BUTTON_TYPE_CANCEL = 4,
MSG_DIALOG_BUTTON_TYPE_3BUTTONS = 5,
}
Dialog result, the button or action that resulted in the dialog closing.
public enum EnumCommonDialogResult
{
RESULT_BUTTON_NOT_SET,
RESULT_BUTTON_OK,
RESULT_BUTTON_CANCEL,
RESULT_BUTTON_YES,
RESULT_BUTTON_NO,
RESULT_BUTTON_1,
RESULT_BUTTON_2,
RESULT_BUTTON_3,
RESULT_CANCELED,
RESULT_ABORTED,
RESULT_CLOSED,
}
Events.
OnGotDialogResult Triggered when a dialog has closed and the result is available.
Properties.
public static bool IsDialogOpen
Is a dialog open?
Methods.
public static bool ShowErrorMessage(UInt32 errorCode)
Display an error message.
public static bool ShowSystemMessage(EnumSystemMessageType type, bool infoBar, int value)
Display a system message.
public static bool ShowProgressBar(string message)
Display a progress bar.
public static bool SetProgressBarPercent(int percent)
Set progress bar percentage (0-100).
public static bool SetProgressBarMessage(string message)
Set progress bar message string.
public static bool ShowUserMessage(EnumUserMessageType type, bool infoBar, string str)
Show a user message.
public static bool ShowUserMessage3Button(bool infoBar, string str, string button1, string button2, string button3)
Show a user message with 3 custom buttons.
public static bool Close()
Close the dialog.
public static EnumCommonDialogResult GetResult()
Get the result from the dialog that's just closed.
Sony.Vita.Dialog.Common.Ime
Enumerations.
ImeParam enterLabel
public enum EnumImeDialogEnterLabel
{
ENTER_LABEL_DEFAULT,
ENTER_LABEL_SEND,
ENTER_LABEL_SEARCH,
ENTER_LABEL_GO,
}
ImeParam type
public enum EnumImeDialogType
{
TYPE_DEFAULT, UI for regular text input
TYPE_BASIC_LATIN, UI for alphanumeric character input
TYPE_NUMBER, UI for number input
TYPE_EXTENDED_NUMBER, UI for extended number input
TYPE_URL, UI for entering URL
TYPE_MAIL, UI for entering an email address
}
Dialog result.
public enum EnumImeDialogResult
{
RESULT_OK, User selected either close button or Enter button
RESULT_USER_CANCELED, User performed cancel operation.
RESULT_ABORTED, IME Dialog operation has been aborted.
}
Dialog result button.
public enum EnumImeDialogResultButton
{
BUTTON_NONE, IME Dialog operation has been aborted or canceled.
BUTTON_CLOSE, User selected close button
BUTTON_ENTER, User selected Enter button
}
Flags.
ImeParam textBoxMode, can be OR'd together.
[Flags] public enum FlagsTextBoxMode
{
TEXTBOX_MODE_DEFAULT = 0x00, Text box for regular sentence input
TEXTBOX_MODE_PASSWORD = 0x01, Text box for password input
TEXTBOX_MODE_WITH_CLEAR = 0x02, Text box with clear button
};
ImeParam option, can be OR'd together.
[Flags] public enum FlagsTextBoxOption
{
OPTION_DEFAULT = 0x00,
OPTION_MULTILINE = 0x01, Multiline input option. This option is not available for libime. This can be used only for the IME Dialog library.
OPTION_NO_AUTO_CAPITALIZATION = 0x02, Prohibits automatic capitalization
OPTION_NO_ASSISTANCE = 0x04, Prohibits input assistance UIs, such as predictive text and conversion candidate
}
Structures.
public class ImeDialogParams
{
public EnumImeDialogType type; Dialog type.
public FlagsTextBoxOption option; Option flags.
public bool canCancel; Whether or not to add the cancel button.
public FlagsTextBoxMode textBoxMode; Text box mode.
public EnumImeDialogEnterLabel enterLabel; Type of enter label.
public int maxTextLength; Maximum text length.
public string title; Dialog title.
public string initialText; Initial text for the text entry field.
};
public struct ImeDialogResult
{
public EnumImeDialogResult result; Dialog result.
public EnumImeDialogResultButton button; Dialog result button.
public string text; The text as entered by the user.
};
Events.
OnGotIMEDialogResult Triggered when the dialog has closed and the result is ready.
Properties.
public static bool IsDialogOpen
Is the IME dialog open?
Methods.
public static bool Open(ImeDialogParams info)
Opens the IME dialog.
public static ImeDialogResult GetResult()
Gets the IME dialog result.

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 645d232ed154b0443b42d44bdfa597b1
TextScriptImporter:
userData:

View File

@ -0,0 +1,31 @@
fileFormatVersion: 2
guid: e4a33d16bdff8ff418e7a5fe120bd193
timeCreated: 1499268372
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
PSP2: PSP2
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b3de348afcfb8214ea5dced94199f16e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eb76ae7b43c117c449fe04e536cf3f34
MonoAssemblyImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
userData:

View File

@ -35,6 +35,7 @@ namespace AxibugEmuOnline.Client.Manager
Protobuf_Room_Create _Protobuf_Room_Create = new Protobuf_Room_Create();
Protobuf_Room_Join _Protobuf_Room_Join = new Protobuf_Room_Join();
Protobuf_Room_Leave _Protobuf_Room_Leave = new Protobuf_Room_Leave();
Protobuf_Room_Change_PlaySlotWithJoy _Protobuf_Room_Change_PlaySlotWithJoy = new Protobuf_Room_Change_PlaySlotWithJoy();
Protobuf_Room_Player_Ready _Protobuf_Room_Player_Ready = new Protobuf_Room_Player_Ready();
Protobuf_Room_SinglePlayerInputData _Protobuf_Room_SinglePlayerInputData = new Protobuf_Room_SinglePlayerInputData();
Protobuf_Screnn_Frame _Protobuf_Screnn_Frame = new Protobuf_Screnn_Frame();
@ -401,6 +402,29 @@ namespace AxibugEmuOnline.Client.Manager
//}
}
/// <summary>
/// 发送修改玩家槽位
/// </summary>
/// <param name="dictSlotIdx2LocalJoyIdx">玩家占用房间GamePlaySlot和LocalJoyIdx字典</param>
public void SendChangePlaySlotIdxWithJoyIdx(Dictionary<uint, uint> dictSlotIdx2LocalJoyIdx)
{
if (!InRoom)
return;
_Protobuf_Room_Change_PlaySlotWithJoy.SlotWithJoy.Clear();
foreach (var slotdata in dictSlotIdx2LocalJoyIdx)
{
_Protobuf_Room_Change_PlaySlotWithJoy.SlotWithJoy.Add(new Protobuf_PlaySlotIdxWithJoyIdx()
{
PlayerSlotIdx = (int)slotdata.Key,
PlayerLocalJoyIdx = (int)slotdata.Value,
});
}
App.log.Info($"SendChangePlaySlotIdxWithJoyIdx");
App.network.SendToServer((int)CommandID.CmdRoomChangePlayerWithJoy, ProtoBufHelper.Serizlize(_Protobuf_Room_Change_PlaySlotWithJoy));
}
/// <summary>
/// 上报即时存档
/// </summary>

View File

@ -1,3 +1,4 @@
using AxibugEmuOnline.Client.ClientCore;
using System;
using System.Collections.Generic;
using UnityEngine;
@ -20,11 +21,13 @@ namespace AxibugEmuOnline.Client
m_InputUI.gameObject.SetActive(false);
}
public static InputUI Input(Action<string> callback, string placeHolder, string defaultText)
public static void Input(Action<string> callback, string placeHolder, string defaultText)
{
#if UNITY_PSP2
App.sonyVitaCommonDialog.ShowPSVitaIME(callback, placeHolder, defaultText);
#else
s_ins.m_InputUI.Show(new ValueTuple<Action<string>, string, string>(callback, placeHolder, defaultText));
return s_ins.m_InputUI;
#endif
}
public static void PopSideBar<T>(List<T> menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu

View File

@ -642,7 +642,11 @@ namespace AxibugEmuOnline.Server
ScreenProviderUID = hostUId;
if (PlayerSlot == null)
{
PlayerSlot = new Data_RoomSlot[4];
for (uint i = 0; i < PlayerSlot.Length; i++)
PlayerSlot[i] = new Data_RoomSlot();
}
for (uint i = 0; i < PlayerSlot.Length; i++)
PlayerSlot[i].Init(i);
@ -814,7 +818,8 @@ namespace AxibugEmuOnline.Server
foreach (var slotdata in newSlotIdx2JoyIdx)
{
PlayerSlot[slotdata.Key].LocalJoyIdx = slotdata.Value;
AppSrv.g_Log.Debug($"SetPlayerUID RoomID->{RoomID} _c.UID->{_c.UID} PlayerSlotIdx->{slotdata.Key} LocalJoyIdx->{slotdata.Value}");
PlayerSlot[slotdata.Key].UID = _c.UID;
AppSrv.g_Log.DebugCmd($"SetPlayerSlot RoomID->{RoomID} _c.UID->{_c.UID} PlayerSlotIdx->{slotdata.Key} LocalJoyIdx->{slotdata.Value}");
}
//更新需要同步的UID
UpdateSynUIDs();