Skip to content

Commit 5f9de42

Browse files
committed
Updated active skill, current skill and hot bars now saved on DB. need to clean up and wipe from DB on delete char.
1 parent a25e1af commit 5f9de42

File tree

3 files changed

+173
-5
lines changed

3 files changed

+173
-5
lines changed

.gitignore

+152-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,155 @@
11

22
src/Mooege/Mooege-VS2010.suo
33
src/Mooege-VS2010.sln
4-
*.orig
4+
*.orig
5+
src/Mooege/bin
6+
src/Mooege/bin/Debug
7+
src/Mooege/bin/Release
8+
src/Mooege/bin/Release/AStar.dll
9+
src/Mooege/bin/Release/AStar.pdb
10+
src/Mooege/bin/Release/c06c3a43f760b9ef2c7965ac229531d17e93279cd2666bf1b9f130b8db5cb2f9.achv
11+
src/Mooege/bin/Release/config.ini
12+
src/Mooege/bin/Release/CrystalMpq.dll
13+
src/Mooege/bin/Release/CrystalMpq.xml
14+
src/Mooege/bin/Release/Gibbed.IO.dll
15+
src/Mooege/bin/Release/Google.ProtocolBuffers.dll
16+
src/Mooege/bin/Release/ICSharpCode.SharpZipLib.dll
17+
src/Mooege/bin/Release/libeay32.dll
18+
src/Mooege/bin/Release/LibMooNet.dll
19+
src/Mooege/bin/Release/logs
20+
src/Mooege/bin/Release/ManagedOpenSsl.dll
21+
src/Mooege/bin/Release/ManagedOpenSsl.dll.config
22+
src/Mooege/bin/Release/ManagedOpenSsl.xml
23+
src/Mooege/bin/Release/Mooege.exe
24+
src/Mooege/bin/Release/Mooege.exe.config
25+
src/Mooege/bin/Release/Nini.dll
26+
src/Mooege/bin/Release/PowerCollections.dll
27+
src/Mooege/bin/Release/PowerCollections.xml
28+
src/Mooege/bin/Release/ssleay32.dll
29+
src/Mooege/bin/Release/System.Data.SQLite.dll
30+
src/Mooege/bin/Release/logs/mooege.log
31+
src/Mooege/bin/Release/logs/packet-dump.log
32+
src/Mooege/bin/Release/Assets/account.db
33+
src/Mooege/bin/Release/Assets/mpqdata.db
34+
src/Mooege/bin/Debug/AStar.dll
35+
src/Mooege/bin/Debug/c06c3a43f760b9ef2c7965ac229531d17e93279cd2666bf1b9f130b8db5cb2f9.achv
36+
src/Mooege/bin/Debug/config.ini
37+
src/Mooege/bin/Debug/CrystalMpq.dll
38+
src/Mooege/bin/Debug/Gibbed.IO.dll
39+
src/Mooege/bin/Debug/Google.ProtocolBuffers.dll
40+
src/Mooege/bin/Debug/ICSharpCode.SharpZipLib.dll
41+
src/Mooege/bin/Debug/libcrypto.1.0.0.dylib
42+
src/Mooege/bin/Debug/libeay32.dll
43+
src/Mooege/bin/Debug/LibMooNet.dll
44+
src/Mooege/bin/Debug/LibMooNet.dll.mdb
45+
src/Mooege/bin/Debug/logs
46+
src/Mooege/bin/Debug/ManagedOpenSsl.dll
47+
src/Mooege/bin/Debug/ManagedOpenSsl.dll.config
48+
src/Mooege/bin/Debug/Mooege.exe
49+
src/Mooege/bin/Debug/Mooege.exe.config
50+
src/Mooege/bin/Debug/Mooege.exe.mdb
51+
src/Mooege/bin/Debug/Mooege.vshost.exe
52+
src/Mooege/bin/Debug/Mooege.vshost.exe.config
53+
src/Mooege/bin/Debug/Mooege.vshost.exe.manifest
54+
src/Mooege/bin/Debug/Nini.dll
55+
src/Mooege/bin/Debug/PowerCollections.dll
56+
src/Mooege/bin/Debug/ssleay32.dll
57+
src/Mooege/bin/Debug/System.Data.SQLite.dll
58+
src/Mooege/bin/Debug/Assets/account.db
59+
src/Mooege/bin/Debug/Assets/mpqdata.db
60+
src/Mooege/bin/Debug/Assets
61+
src/Mooege/bin/Debug/Assets/MPQ
62+
src/Mooege/bin/Debug/Assets/MPQ/base
63+
src/Mooege/bin/Debug/Assets/MPQ/base-Win.mpq
64+
src/Mooege/bin/Debug/Assets/MPQ/Cache
65+
src/Mooege/bin/Debug/Assets/MPQ/ClientData.mpq
66+
src/Mooege/bin/Debug/Assets/MPQ/CoreData.mpq
67+
src/Mooege/bin/Debug/Assets/MPQ/enUS
68+
src/Mooege/bin/Debug/Assets/MPQ/enUS_Audio.mpq
69+
src/Mooege/bin/Debug/Assets/MPQ/enUS_Cutscene.mpq
70+
src/Mooege/bin/Debug/Assets/MPQ/enUS_Text.mpq
71+
src/Mooege/bin/Debug/Assets/MPQ/HLSLShaders.mpq
72+
src/Mooege/bin/Debug/Assets/MPQ/IMPORTANT
73+
src/Mooege/bin/Debug/Assets/MPQ/Sound.mpq
74+
src/Mooege/bin/Debug/Assets/MPQ/Texture.mpq
75+
src/Mooege/bin/Debug/Assets/MPQ/Win
76+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7170.MPQ
77+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7200.MPQ
78+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7318.MPQ
79+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7338.MPQ
80+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7447.MPQ
81+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7728.MPQ
82+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7841.MPQ
83+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-7931.MPQ
84+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-8059.MPQ
85+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-8101.MPQ
86+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-8296.MPQ
87+
src/Mooege/bin/Debug/Assets/MPQ/base/d3-update-base-8350.MPQ
88+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7170.MPQ
89+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7200.MPQ
90+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7318.MPQ
91+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7338.MPQ
92+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7447.MPQ
93+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7728.MPQ
94+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7841.MPQ
95+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-7931.MPQ
96+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-8059.MPQ
97+
src/Mooege/bin/Debug/Assets/MPQ/enUS/d3-update-enUS-8296.MPQ
98+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7200.MPQ
99+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7318.MPQ
100+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7338.MPQ
101+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7447.MPQ
102+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7728.MPQ
103+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7841.MPQ
104+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-7931.MPQ
105+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-8059.MPQ
106+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-8101.MPQ
107+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-8296.MPQ
108+
src/Mooege/bin/Debug/Assets/MPQ/Win/d3-update-Win-8350.MPQ
109+
src/Mooege/bin/Debug/logs/mooege.log
110+
src/Mooege/bin/Debug/logs/packet-dump.log
111+
src/Mooege/bin/Release/Assets/MPQ/base-Win.mpq
112+
src/Mooege/bin/Release/Assets/MPQ/Cache
113+
src/Mooege/bin/Release/Assets/MPQ/ClientData.mpq
114+
src/Mooege/bin/Release/Assets/MPQ/CoreData.mpq
115+
src/Mooege/bin/Release/Assets/MPQ/enUS
116+
src/Mooege/bin/Release/Assets/MPQ/enUS_Audio.mpq
117+
src/Mooege/bin/Release/Assets/MPQ/enUS_Cutscene.mpq
118+
src/Mooege/bin/Release/Assets/MPQ/enUS_Text.mpq
119+
src/Mooege/bin/Release/Assets/MPQ/HLSLShaders.mpq
120+
src/Mooege/bin/Release/Assets/MPQ/IMPORTANT
121+
src/Mooege/bin/Release/Assets/MPQ/Sound.mpq
122+
src/Mooege/bin/Release/Assets/MPQ/Texture.mpq
123+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7200.MPQ
124+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7318.MPQ
125+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7338.MPQ
126+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7447.MPQ
127+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7728.MPQ
128+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7841.MPQ
129+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-7931.MPQ
130+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-8059.MPQ
131+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-8101.MPQ
132+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-8296.MPQ
133+
src/Mooege/bin/Release/Assets/MPQ/Win/d3-update-Win-8350.MPQ
134+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7170.MPQ
135+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7200.MPQ
136+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7318.MPQ
137+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7338.MPQ
138+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7447.MPQ
139+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7728.MPQ
140+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7841.MPQ
141+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-7931.MPQ
142+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-8059.MPQ
143+
src/Mooege/bin/Release/Assets/MPQ/enUS/d3-update-enUS-8296.MPQ
144+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7170.MPQ
145+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7200.MPQ
146+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7318.MPQ
147+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7338.MPQ
148+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7447.MPQ
149+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7728.MPQ
150+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7841.MPQ
151+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-7931.MPQ
152+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-8059.MPQ
153+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-8101.MPQ
154+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-8296.MPQ
155+
src/Mooege/bin/Release/Assets/MPQ/base/d3-update-base-8350.MPQ

src/Mooege/Core/GS/Players/Player.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ private void OnAssignActiveSkill(GameClient client, AssignActiveSkillMessage mes
540540

541541
this.SkillSet.ActiveSkills[message.SkillIndex] = message.SNOSkill;
542542
this.SkillSet.UpdateAssignedSkill(message.SkillIndex,message.SNOSkill,this.Toon);
543+
this.SkillSet.SwitchUpdateSkills(oldSNOSkill,message.SNOSkill,this.Toon);
543544
this.UpdateHeroState();
544545

545546
}
@@ -567,7 +568,9 @@ private void OnAssignPassiveSkill(GameClient client, AssignPassiveSkillMessage m
567568
private void OnPlayerChangeHotbarButtonMessage(GameClient client, PlayerChangeHotbarButtonMessage message)
568569
{
569570
//this.SkillSet.HotBarSkills[message.BarIndex] = message.ButtonData;
570-
571+
572+
this.SkillSet.HotBarSkills[message.BarIndex].SNOSkill = message.ButtonData.SNOSkill;
573+
571574
Logger.Debug("HB Skill changed {0}", message.ButtonData.SNOSkill);
572575
Logger.Debug("HB Position {0}", message.BarIndex);
573576
Logger.Debug("Char involved on HB change {0}", this.Toon.D3EntityID.IdLow);

src/Mooege/Core/GS/Skills/SkillSet.cs

+17-3
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ public SkillSet(ToonClass @class,Toon toon)
5050
var cmd = new SQLiteCommand(query, DBManager.Connection);
5151
var reader = cmd.ExecuteReader();
5252

53-
53+
//30592 base attack
5454

5555
if (!reader.HasRows)
5656
{
57-
var query_first_insert = string.Format("INSERT INTO active_skills (id_toon,skill_0,skill_1,skill_2,skill_3,skill_4,skill_5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], Skills.None, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None);
57+
var query_first_insert = string.Format("INSERT INTO active_skills (id_toon,skill_0,skill_1,skill_2,skill_3,skill_4,skill_5) VALUES ({0},{1},{2},{3},{4},{5},{6} )", toon.D3EntityID.IdLow, this.CurrentActiveSkills[0], 30592, Skills.None, Skills.None, Skills.None, Skills.None, Skills.None);
5858
var cmd_first_insert = new SQLiteCommand(query_first_insert, DBManager.Connection);
5959
cmd_first_insert.ExecuteReader();
6060
Logger.Debug("SkillSet: No Entry for {0}", toon.D3EntityID.IdLow);
6161
this.HotBarSkills = new HotbarButtonData[9] {
6262
new HotbarButtonData { SNOSkill = this.CurrentActiveSkills[0], ItemGBId = -1 }, // left-click
63-
new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // right-click
63+
new HotbarButtonData { SNOSkill = 30592, ItemGBId = -1 }, // right-click
6464
new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - left-click switch - which key??
6565
new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame)
6666
new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = -1 }, // bar-1
@@ -215,6 +215,20 @@ public void UpdateAssignedSkill(int skillIndex, int SNOSkill,Toon toon)
215215
}
216216

217217
}
218+
219+
public void SwitchUpdateSkills (int oldSNOSkill,int SNOSkill, Toon toon)
220+
{
221+
for (int i = 0; i < this.HotBarSkills.Length; i++)
222+
{
223+
if(this.HotBarSkills[i].SNOSkill == oldSNOSkill)
224+
{
225+
Logger.Debug("SkillSet: SwitchUpdateSkill Oldskill {0} Newskill {1}",oldSNOSkill,SNOSkill);
226+
this.HotBarSkills[i].SNOSkill = SNOSkill;
227+
this.UpdateHotbarSkills(,SNOSkill,toon);
228+
return;
229+
}
230+
}
231+
}
218232

219233
}
220234
}

0 commit comments

Comments
 (0)