470 {
471 int tmp = -1;
473
474 int type = -1;
476 return;
477
478 switch (type)
479 {
481 {
482 InventoryLocation src = new InventoryLocation();
483 InventoryLocation dst = new InventoryLocation();
484
487 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] t=" +
GetGame().
GetTime() +
"ms ServerInventoryCommand cmd=" +
typename.EnumToString(
InventoryCommandType, type) +
" src=" + InventoryLocation.DumpToStringNullSafe(src) +
" dst=" + InventoryLocation.DumpToStringNullSafe(dst));
488
490 {
491 Error(
"[syncinv] ServerInventoryCommand (cmd=SYNC_MOVE) dropped, item not in bubble");
492 break;
493 }
494
496 break;
497 }
498
500 {
503
504 if (!e.GetSrcEntity())
505 {
506 Error(
"[syncinv] ServerInventoryCommand (cmd=HAND_EVENT) dropped, item not in bubble");
507 break;
508 }
509 e.m_Player.GetHumanInventory().ProcessHandEvent(e);
510 break;
511 }
512
515 {
516 InventoryLocation src1 = new InventoryLocation();
517 InventoryLocation src2 = new InventoryLocation();
518 InventoryLocation dst1 = new InventoryLocation();
519 InventoryLocation dst2 = new InventoryLocation();
524
526 {
527 if (LogManager.IsSyncLogEnable())
syncDebugPrint(
"[syncinv] t=" +
GetGame().
GetTime() +
"ms ServerInventoryCommand Swap src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2) +
" dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) +
" dst2=" + InventoryLocation.DumpToStringNullSafe(dst2));
528
530 }
531 else
532 Error(
"ServerInventoryCommand - cannot swap, invalid location input: src1=" + InventoryLocation.DumpToStringNullSafe(src1) +
" src2=" + InventoryLocation.DumpToStringNullSafe(src2) +
" dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) +
" dst2=" + InventoryLocation.DumpToStringNullSafe(dst2));
533
534 break;
535 }
536 }
537 }
void syncDebugPrint(string s)
void HandEventBase(Man p=null, InventoryLocation src=null)
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
override string DumpToString()
proto native bool IsValid()
verify current set inventory location
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
proto bool Read(void value_in)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.