ofs | hex dump | ascii |
---|
0000 | 42 42 33 44 0e 9c 00 00 01 00 00 00 42 52 55 53 2e 00 00 00 01 00 00 00 42 72 75 73 68 2e 30 30 | BB3D........BRUS........Brush.00 |
0020 | 31 00 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 00 00 01 00 00 00 00 00 00 00 ff ff | 1....?...?...?...?.............. |
0040 | ff ff 4e 4f 44 45 cc 9b 00 00 64 74 72 61 63 6b 5f 73 77 72 63 72 5f 36 30 00 00 00 00 00 00 00 | ..NODE....dtrack_swrcr_60....... |
0060 | 00 bf 00 00 00 00 fd ff 7f 3f 00 00 80 3f fd ff 7f 3f af b0 59 3f 00 00 00 00 f7 b5 06 3f 00 00 | .........?...?...?..Y?.......?.. |
0080 | 00 00 4d 45 53 48 8c 9b 00 00 ff ff ff ff 56 52 54 53 8c 83 00 00 01 00 00 00 01 00 00 00 02 00 | ..MESH........VRTS.............. |
00a0 | 00 00 0a cb d0 be 28 5c 0f 3e 50 18 73 be 00 1b 00 bf 64 c1 31 3f 09 61 04 bf a5 ff 00 3e 24 e4 | ......(\.>P.s.....d.1?.a.....>$. |
00c0 | 04 3f 84 cc ba be 28 5c 0f 3e fc 31 64 be 15 4d 0a 3f 70 2d 38 3f bf 75 df 3e 4b 1f 37 3e 27 e4 | .?....(\.>.1d..M.?p-8?.u.>K.7>'. |
00e0 | 04 3f 1a 89 d5 be 28 5c 0f 3e 83 2a 1a be 2a 23 15 3f 6f a7 37 3f 87 95 c3 3e 4c 1f 37 3e 34 13 | .?....(\.>.*..*#.?o.7?...>L.7>4. |
0100 | dd 3e ae e9 f2 be 28 5c 0f 3e 44 fe 28 be 19 8b 0c bf 65 6d 32 3f d8 25 ec be a4 ff 00 3e 2e 13 | .>....(\.>D.(.....em2?.%.....>.. |
0120 | dd 3e f8 14 a6 be 28 5c 0f 3e 81 5d 9e be c9 4d e4 be 66 d1 32 3f 1f 45 0f bf a7 ff 00 3e b1 3e | .>....(\.>.]...M..f.2?.E.....>.> |
0140 | 1b 3f 0a a7 99 be 28 5c 0f 3e b2 df 96 be 08 e1 03 3f 6c eb 35 3f eb 51 f5 3e 4a 1f 37 3e b3 3e | .?....(\.>.......?l.5?.Q.>J.7>.> |
0160 | 1b 3f 84 cc ba be 28 5c 0f 3e fc 31 64 be 15 4d 0a 3f 70 2d 38 3f bf 75 df 3e 4b 1f 37 3e 27 e4 | .?....(\.>.1d..M.?p-8?.u.>K.7>'. |
0180 | 04 3f 0a cb d0 be 28 5c 0f 3e 50 18 73 be 00 1b 00 bf 64 c1 31 3f 09 61 04 bf a5 ff 00 3e 24 e4 | .?....(\.>P.s.....d.1?.a.....>$. |
01a0 | 04 3f 10 34 5b be c8 ba 22 3d 9d e7 c7 be c2 01 61 3d 2c 2d 16 bf 9e d7 4e bf ca 00 96 3e 3c 99 | .?.4[..."=......a=,-....N....><. |
01c0 | 31 3f f8 14 a6 be c8 ba 22 3d 81 5d 9e be c9 4d e4 be 66 d1 32 bf 1f 45 0f bf cb 00 96 3e af 3e | 1?......"=.]...M..f.2..E.....>.> |
01e0 | 1b 3f 0a a7 99 be c8 ba 22 3d b2 df 96 be 08 e1 03 3f 6c eb 35 bf eb 51 f5 3e e4 e1 75 3e b3 3e | .?......"=.......?l.5..Q.>..u>.> |
0200 | 1b 3f c4 16 58 be c8 ba 22 3d 1a 65 c6 be a2 ef 50 3f 28 dd 13 bf e1 81 70 bc e0 e1 75 3e 40 99 | .?..X..."=.e....P?(.....p...u>@. |
0220 | 31 3f 0a a7 99 be 28 5c 0f 3e b2 df 96 be 08 e1 03 3f 6c eb 35 3f eb 51 f5 3e 4a 1f 37 3e b3 3e | 1?....(\.>.......?l.5?.Q.>J.7>.> |
0240 | 1b 3f f8 14 a6 be 28 5c 0f 3e 81 5d 9e be c9 4d e4 be 66 d1 32 3f 1f 45 0f bf a7 ff 00 3e b1 3e | .?....(\.>.]...M..f.2?.E.....>.> |
0260 | 1b 3f 10 34 5b be 28 5c 0f 3e 9d e7 c7 be c2 01 61 3d 2c 2d 16 3f 9e d7 4e bf a9 ff 00 3e 3e 99 | .?.4[.(\.>......a=,-.?..N....>>. |
0280 | 31 3f c4 16 58 be 28 5c 0f 3e 1a 65 c6 be a2 ef 50 3f 28 dd 13 3f e1 81 70 bc 4a 1f 37 3e 40 99 | 1?..X.(\.>.e....P?(..?..p.J.7>@. |
02a0 | 31 3f 70 1c 14 bf c8 ba 22 3d 60 2c 9c bc 38 0f 1c bf 66 ed 32 bf 7f 71 bf be ce 00 96 3e fe a8 | 1?p....."=`,..8...f.2..q.....>.. |
02c0 | 83 3e f8 37 24 bf c8 ba 22 3d 00 73 bd 3d 46 1d 23 bf 65 bb 32 bf 4e 1d a7 be cf 00 96 3e cc e7 | .>.7$..."=.s.=F.#.e.2.N......>.. |
02e0 | 2d 3e fe 6d 10 bf c8 ba 22 3d 6c 57 03 3e 47 4b 23 3f 6c c1 35 bf 32 c5 98 3e f9 e1 75 3e d0 e7 | ->.m...."=lW.>GK#?l.5.2..>..u>.. |
0300 | 2d 3e 3b 6c 02 bf c8 ba 22 3d 60 22 77 3c 42 c9 20 3f 6c f9 35 bf 44 11 a2 3e f5 e1 75 3e 02 a9 | ->;l...."=`"w<B..?l.5.D..>..u>.. |
0320 | 83 3e 20 37 07 bf c8 ba 22 3d 18 2a c2 bd 2a d7 14 bf 66 1f 33 bf a9 89 d4 be ce 00 96 3e 16 5e | .>.7...."=.*..*...f.3........>.^ |
0340 | b0 3e 70 1c 14 bf c8 ba 22 3d 60 2c 9c bc 38 0f 1c bf 66 ed 32 bf 7f 71 bf be ce 00 96 3e fe a8 | .>p....."=`,..8...f.2..q.....>.. |
0360 | 83 3e 3b 6c 02 bf c8 ba 22 3d 60 22 77 3c 42 c9 20 3f 6c f9 35 bf 44 11 a2 3e f5 e1 75 3e 02 a9 | .>;l...."=`"w<B..?l.5.D..>..u>.. |
0380 | 83 3e 5e e5 ed be c8 ba 22 3d f0 fe 8f bd 39 b7 1c 3f 6d 85 36 bf 5e 05 af 3e f1 e1 75 3e 1c 5e | .>^....."=....9..?m.6.^..>..u>.^ |
03a0 | b0 3e ae e9 f2 be c8 ba 22 3d 44 fe 28 be 19 8b 0c bf 65 6d 32 bf d8 25 ec be cd 00 96 3e 2e 13 | .>......"=D.(.....em2..%.....>.. |
03c0 | dd 3e 20 37 07 bf c8 ba 22 3d 18 2a c2 bd 2a d7 14 bf 66 1f 33 bf a9 89 d4 be ce 00 96 3e 16 5e | .>.7...."=.*..*...f.3........>.^ |
03e0 | b0 3e 5e e5 ed be c8 ba 22 3d f0 fe 8f bd 39 b7 1c 3f 6d 85 36 bf 5e 05 af 3e f1 e1 75 3e 1c 5e | .>^....."=....9..?m.6.^..>..u>.^ |
0400 | b0 3e 1a 89 d5 be c8 ba 22 3d 83 2a 1a be 2a 23 15 3f 6f a7 37 bf 87 95 c3 3e ed e1 75 3e 34 13 | .>......"=.*..*#.?o.7....>..u>4. |
0420 | dd 3e 0a cb d0 be c8 ba 22 3d 50 18 73 be 00 1b 00 bf 64 c1 31 bf 09 61 04 bf cc 00 96 3e 23 e4 | /*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef INVENTORYMANAGER_HEADER
#define INVENTORYMANAGER_HEADER
#include "inventory.h"
#include <iostream>
#include <string>
class ServerActiveObject;
struct InventoryLocation
{
enum Type{
UNDEFINED,
CURRENT_PLAYER,
PLAYER,
NODEMETA,
DETACHED,
} type;
std::string name; // PLAYER, DETACHED
v3s16 p; // NODEMETA
InventoryLocation()
{
setUndefined();
}
void setUndefined()
{
type = UNDEFINED;
}
void setCurrentPlayer()
{
type = CURRENT_PLAYER;
}
void setPlayer(const std::string &name_)
{
type = PLAYER;
name = name_;
}
void setNodeMeta(v3s16 p_)
{
type = NODEMETA;
p = p_;
}
void setDetached(const std::string &name_)
{
type = DETACHED;
name = name_;
}
bool operator==(const InventoryLocation &other) const
{
if(type != other.type)
return false;
switch(type){
case UNDEFINED:
return false;
case CURRENT_PLAYER:
return true;
case PLAYER:
return (name == other.name);
case NODEMETA:
return (p == other.p);
case DETACHED:
return (name == other.name);
}
07c0 | 2d 3e dc 74 33 bf c8 ba 22 3d fe 76 62 3e 88 1d 44 bf 28 c1 13 bf 22 c5 90 3e d0 00 96 3e 38 fb | ->.t3..."=.vb>..D.(..."..>...>8. |
07e0 | a8 3d 2a 5c 1f bf c8 ba 22 3d 06 ae 83 3e 25 75 92 3e 27 b9 13 bf 88 d3 43 3f fd e1 75 3e 38 fb | .=*\...."=...>%u.>'.....C?..u>8. |
.>^...(\.>....9..?m.6?^..>L.7>.^ |
0bc0 | b0 3e 5e e5 ed be c8 ba 22 3d f0 fe 8f bd 39 b7 1c 3f 6d 85 36 bf 5e 05 af 3e f1 e1 75 3e 1c 5e | .>^....."=....9..?m.6.^..>..u>.^ |
0be0 | b0 3e 3b 6c 02 bf c8 ba 22 3d 60 22 77 3c 42 c9 20 3f 6c f9 35 bf 44 11 a2 3e f5 e1 75 3e 02 a9 | .>;l...."=`"w<B..?l.5.D..>..u>.. |
0c00 | 83 3e 3b 6c 02 bf 28 5c 0f 3e 60 22 77 3c 42 c9 20 3f 6c f9 35 3f 44 11 a2 3e 4c 1f 37 3e 02 a9 | .>;l..(\.>`"w<B..?l.5?D..>L.7>.. |
0c20 | 83 3e 3b 6c 02 bf 28 5c 0f 3e 60 22 77 3c 42 c9 20 3f 6c f9 35 3f 44 11 a2 3e 4c 1f 37 3e 02 a9 | .>;l..(\.>`"w<B..?l.5?D..>L.7>.. |
0c40 | 83 3e 3b 6c 02 bf c8 ba 22 3d 60 22 77 3c 42 c9 20 3f 6c f9 35 bf 44 11 a2 3e f5 e1 75 3e 02 a9 | .>;l...."=`"w<B..?l.5.D..>..u>.. |
0c60 | 83 3e fe 6d 10 bf c8 ba 22 3d 6c 57 03 3e 47 4b 23 3f 6c c1 35 bf 32 c5 98 3e f9 e1 75 3e d0 e7 | .>.m...."=lW.>GK#?l.5.2..>..u>.. |
0c80 | 2d 3e fe 6d 10 bf 28 5c 0f 3e 6c 57 03 3e 47 4b 23 3f 6c c1 35 3f 32 c5 98 3e 4d 1f 37 3e d0 e7 | ->.m..(\.>lW.>GK#?l.5?2..>M.7>.. |
0ca0 | 2d 3e dc 74 33 bf 28 5c 0f 3e fe 76 62 3e 88 1d 44 bf 28 c1 13 3f 22 c5 90 3e 9e ff 00 3e 28 fb | -
void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef);
void clientApply(InventoryManager *mgr, IGameDef *gamedef);
};
struct IDropAction : public InventoryAction
{
// count=0 means "everything"
u16 count;
InventoryLocation from_inv;
std::string from_list;
s16 from_i;
IDropAction()
{
count = 0;
from_i = -1;
}
IDropAction(std::istream &is);
u16 getType() const
{
return IACTION_DROP;
}
void serialize(std::ostream &os) const
{
os<<"Drop ";
os<<count<<" ";
os<<from_inv.dump()<<" ";
os<<from_list<<" ";
os<<from_i;
}
void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef);
void clientApply(InventoryManager *mgr, IGameDef *gamedef);
};
struct ICraftAction : public InventoryAction
{
// count=0 means "everything"
u16 count;
InventoryLocation craft_inv;
ICraftAction()
{
count = 0;
}
ICraftAction(std::istream &is);
u16 getType() const
{
return IACTION_CRAFT;
}
void serialize(std::ostream &os) const
{
os<<"Craft ";
os<<count<<" ";
os<<craft_inv.dump()<<" ";
}
void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef);
void clientApply(InventoryManager *mgr, IGameDef *gamedef);
};
// Crafting helper
bool getCraftingResult(Inventory *inv, ItemStack& result,
bool decrementInput, IGameDef *gamedef);
#endif
|