DayZ 1.24
Loading...
Searching...
No Matches
InventoryInputUserData Class Reference

Static Private Member Functions

static void SerializeDestroy (ParamsWriteContext ctx, notnull InventoryLocation src)
 
static void SendInputUserDataDestroy (notnull InventoryLocation src)
 
static void SerializeMove (ParamsWriteContext ctx, int type, notnull InventoryLocation src, notnull InventoryLocation dst)
 move
 
static void SendInputUserDataMove (int type, notnull InventoryLocation src, notnull InventoryLocation dst)
 
static void SendServerMove (Man player, int type, notnull InventoryLocation src, notnull InventoryLocation dst)
 
static void SerializeSwap (ParamsWriteContext ctx, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, bool skippedSwap)
 swap
 
static void SendInputUserDataSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, bool skippedSwap=false)
 
static void SendServerSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, bool skippedSwap=false)
 
static void SerializeHandEvent (ParamsWriteContext ctx, HandEventBase e)
 hand
 
static void SendInputUserDataHandEvent (HandEventBase e)
 
static void SendServerHandEventViaInventoryCommand (notnull Man player, HandEventBase e)
 

Detailed Description

Definition at line 2 of file InventoryInputUserData.c.

Member Function Documentation

◆ SendInputUserDataDestroy()

static void InventoryInputUserData::SendInputUserDataDestroy ( notnull InventoryLocation src)
inlinestaticprivate

Definition at line 114 of file InventoryInputUserData.c.

115 {
116 if (GetGame().IsClient())
117 {
118 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] SendInputUserDataDestroy src=" + InventoryLocation.DumpToStringNullSafe(src));
121 ctx.Send();
122 }
123 }
void syncDebugPrint(string s)
Definition Debug.c:1
static void SerializeDestroy(ParamsWriteContext ctx, notnull InventoryLocation src)
InventoryLocation.
static string DumpToStringNullSafe(InventoryLocation loc)
static bool IsSyncLogEnable()
Definition Debug.c:759
proto native CGame GetGame()

References InventoryLocation::DumpToStringNullSafe(), GetGame(), LogManager::IsSyncLogEnable(), SerializeDestroy(), and syncDebugPrint().

◆ SendInputUserDataHandEvent()

static void InventoryInputUserData::SendInputUserDataHandEvent ( HandEventBase e)
inlinestaticprivate

Definition at line 79 of file InventoryInputUserData.c.

80 {
81 if (GetGame().IsClient())
82 {
83 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] t=" + GetGame().GetTime() + "ms SendInputUserDataHandEvent e=" + e.DumpToString());
86 ctx.Send();
87 }
88 }
float GetTime()
static void SerializeHandEvent(ParamsWriteContext ctx, HandEventBase e)
hand

References GetGame(), GetTime(), LogManager::IsSyncLogEnable(), SerializeHandEvent(), and syncDebugPrint().

Referenced by HandleHandEvent().

◆ SendInputUserDataMove()

static void InventoryInputUserData::SendInputUserDataMove ( int type,
notnull InventoryLocation src,
notnull InventoryLocation dst )
inlinestaticprivate

Definition at line 13 of file InventoryInputUserData.c.

14 {
15 if (GetGame().IsClient())
16 {
17 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] t=" + GetGame().GetTime() + "ms sending cmd=" + typename.EnumToString(InventoryCommandType, type) + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
19 SerializeMove(ctx, type, src, dst);
20 ctx.Send();
21 }
22 }
InventoryCommandType
Definition Inventory.c:3
static void SerializeMove(ParamsWriteContext ctx, int type, notnull InventoryLocation src, notnull InventoryLocation dst)
move

References InventoryLocation::DumpToStringNullSafe(), GetGame(), GetTime(), LogManager::IsSyncLogEnable(), SerializeMove(), and syncDebugPrint().

Referenced by HandleTakeToDst().

◆ SendInputUserDataSwap()

static void InventoryInputUserData::SendInputUserDataSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
bool skippedSwap = false )
inlinestaticprivate

Definition at line 48 of file InventoryInputUserData.c.

49 {
50 if (GetGame().IsClient())
51 {
55 ctx.Send();
56 }
57 }
static void SerializeSwap(ParamsWriteContext ctx, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, bool skippedSwap)
swap

References InventoryLocation::DumpToStringNullSafe(), GetGame(), GetTime(), LogManager::IsSyncLogEnable(), SerializeSwap(), and syncDebugPrint().

Referenced by HandleForceSwapEntities(), and HandleSwapEntities().

◆ SendServerHandEventViaInventoryCommand()

static void InventoryInputUserData::SendServerHandEventViaInventoryCommand ( notnull Man player,
HandEventBase e )
inlinestaticprivate

Definition at line 90 of file InventoryInputUserData.c.

91 {
92 // Warning: this uses NetworkMessageInventoryCommand
93 if (GetGame().IsServer())
94 {
95 if (e.IsServerSideOnly())
96 Error("[syncinv] SendServerHandEvent - called on server side event only, e=" + e.DumpToString());
97 if (player.IsAlive())
98 Error("[syncinv] SendServerHandEvent - called on living thing.. server hand command is only for dead people, e=" + e.DumpToString());
99 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] SendServerHandEventViaInventoryCommand SendInputUserDataHandEvent e=" + e.DumpToString());
102 GameInventory.ServerHandEvent(player, e.GetSrcEntity(), ctx);
103 }
104 }
script counterpart to engine's class Inventory
Definition Inventory.c:79
static proto native bool ServerHandEvent(notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
hand event to clients
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), GetGame(), LogManager::IsSyncLogEnable(), SerializeHandEvent(), GameInventory::ServerHandEvent(), and syncDebugPrint().

Referenced by HandleHandEvent().

◆ SendServerMove()

static void InventoryInputUserData::SendServerMove ( Man player,
int type,
notnull InventoryLocation src,
notnull InventoryLocation dst )
inlinestaticprivate

Definition at line 24 of file InventoryInputUserData.c.

25 {
26 if (GetGame().IsServer())
27 {
28 if (LogManager.IsSyncLogEnable()) syncDebugPrint("[syncinv] server sending cmd=" + typename.EnumToString(InventoryCommandType, type) + " src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
30 SerializeMove(ctx, type, src, dst);
32 }
33 }
static proto native bool ServerLocationSyncMoveEntity(Man player, notnull EntityAI item, ParamsWriteContext ctx)
synchronously removes item from current inventory location and adds it to destination + sync via inve...

References InventoryLocation::DumpToStringNullSafe(), GetGame(), LogManager::IsSyncLogEnable(), SerializeMove(), GameInventory::ServerLocationSyncMoveEntity(), and syncDebugPrint().

Referenced by GameInventory::TakeToDst().

◆ SendServerSwap()

static void InventoryInputUserData::SendServerSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
bool skippedSwap = false )
inlinestaticprivate

Definition at line 59 of file InventoryInputUserData.c.

60 {
61 if (GetGame().IsServer())
62 {
67 }
68 }
static proto native bool ServerLocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx)
swaps two entities

References InventoryLocation::DumpToStringNullSafe(), GetGame(), LogManager::IsSyncLogEnable(), SerializeSwap(), GameInventory::ServerLocationSwap(), and syncDebugPrint().

◆ SerializeDestroy()

static void InventoryInputUserData::SerializeDestroy ( ParamsWriteContext ctx,
notnull InventoryLocation src )
inlinestaticprivate

Definition at line 107 of file InventoryInputUserData.c.

108 {
110 ctx.Write(InventoryCommandType.DESTROY);
111 src.WriteToContext(ctx);
112 }
const int INPUT_UDT_INVENTORY
Definition _constants.c:9

References INPUT_UDT_INVENTORY.

Referenced by SendInputUserDataDestroy().

◆ SerializeHandEvent()

static void InventoryInputUserData::SerializeHandEvent ( ParamsWriteContext ctx,
HandEventBase e )
inlinestaticprivate

◆ SerializeMove()

static void InventoryInputUserData::SerializeMove ( ParamsWriteContext ctx,
int type,
notnull InventoryLocation src,
notnull InventoryLocation dst )
inlinestaticprivate

move

Definition at line 5 of file InventoryInputUserData.c.

6 {
8 ctx.Write(type);
9 src.WriteToContext(ctx);
10 dst.WriteToContext(ctx);
11 }

References INPUT_UDT_INVENTORY.

Referenced by OnUpdate(), SendInputUserDataMove(), SendServerMove(), and TakeToDst().

◆ SerializeSwap()

static void InventoryInputUserData::SerializeSwap ( ParamsWriteContext ctx,
notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
bool skippedSwap )
inlinestaticprivate

swap

Definition at line 37 of file InventoryInputUserData.c.

38 {
40 ctx.Write(InventoryCommandType.SWAP);
41 src1.WriteToContext(ctx);
42 src2.WriteToContext(ctx);
43 dst1.WriteToContext(ctx);
44 dst2.WriteToContext(ctx);
45 ctx.Write(skippedSwap);
46 }

References INPUT_UDT_INVENTORY.

Referenced by SendInputUserDataSwap(), SendServerSwap(), and ValidateSwap().


The documentation for this class was generated from the following file: