« first day (1738 days earlier)      last day (1105 days later) » 

12:00 AM
Warnings/diagnostic discipline as well.
@IrinelIovan NetClients have a Connect function. Confusingly it takes an argument that is ignored, but probably shouldn't always be?
Specifically when it tries to reconnect it passes a different endpoint_iterator (not m_endpointStart)
Yup. Looks to me that NetClient.cpp line 61 must be:
	asio::async_connect(GetSocket(), endpoint_iterator, std::bind(&NetClient::HandleConnect, std::static_pointer_cast<NetClient>(shared_from_this()), std::placeholders::_1, std::placeholders::_2));
 
Nooo ideaaaaaaaaaaaaaa
I tried over and over
to figure it
 
I'm done impact analyzing this line. It was just an error. You can fix that one. No clue whether it's related to the problem of course
 
Looks like it give u a hard time xd
 
It would be something if anyone could magically read this and go "Ah, there it is". But this is one tangible thing, and it might actually have an impact. So... it's a start
I'm also really confused why the async completion handlers is passed weak_ptrs. It looks like it should be fine though, because the std::bind expressions will contain the locked shared pointer anyways.
 
well, like i said.. if u can figure it.. Im gonna pay u, u my last hope. u wont do it free
 
12:12 AM
I'm looking. I'm currently without a job so I have some time. What's your TZ?
 
GMT +3
03:13 MORNING
 
Where's that :) It's 2:14am here
 
romania is
 
Ah. Nice. I was going the wrong way (and thought you lived in the Atlantic :))
The Netherlands here.
 
ayyaya
what happened with livecoding brw?
i looked sometimes to your lives
xd
 
12:21 AM
They killed free accounts
@IrinelIovan Wow. People keep telling me. I had no idea I had viewers :)
Added this to my SO profile a while back in response to the many queries:
> Sadly they removed all of the few hundreds hours of stream after they changed-over their business model a few times. There will be quite a few now-dead links to streams in the comments at my answers. I'm sorry.
@sehe pleasantly surprised the whole server is single threaded
 
yes it's single thread
xd
It was an initial code
it's a need to make it multi
ex, when 250 connections reached move new thread..
on 16 im gonna open my game, so if u have time.. u can work for me and rewrite whole game network
it's very crap
 
Well. You know. Everything is operating under single thread assumption. I think it should be fine for ~10kreq/s
@IrinelIovan lol
Funny. In NetClient.cpp line 69 _this can never be null.
This closely related to my remark about passing weak_ptr to completion handler. Since then I spent a detour to very single-threadedness
 
12:43 AM
tik tok tik tok
 
hrm?
 
until opening, im counting time
 
I went on the angle of packet sizes/buffers. Max packet size is 291 bytes. DBclient uses 5000 buffer input size , output buffer defaults to 32kb
@IrinelIovan So, now looking at buffer access patterns. TBH, I think there's only ever going to be a single request on a authclient right?
Communication is not full-duplex looks like? And auth would be sequential regardless, being auth.
 
well, it works like this.
 
grabs popcorn
(really grabbing tea)
 
12:48 AM
User has open client, it's in login screen.. he enter user/password.. It receive auth core the packet and data
TPacketCGAuth
in packet.h
then it runs the query stQuery
select from databse user/id etc
then it jumps to OnLoginSQLQuery
 
skipped over Auth->Db comms there
 
it sore selected data from mysql database m_dbManager.async_store_result
 
but yeah.
 
then
m_dbClient->SendAuthLogin(
It will send AuthLogin to db core
 
You can't see my frown atm. So, dbcore doens't do the db stuff? Or just other db stuff
 
12:51 AM
db core verify the codes login data
and answer back to auth
with this packet SPacketDGAuthLogin
void GAuthPeer::LoginSuccess(uint8_t result)
and it come to this
with the result
and login player
basically, it;s like this
client- > auth -> db -> auth
the problem is when auth receive initial request from client
if (!m_dbClient || !m_dbClient->IsConnected())
it jump here
 
Clear. So, buffer overruns are really out of the question there. Unless it's the dbclient queueing up stuff. I'll quickly check that side.
 
what's strange is that db core don't disconnect
for example
If i have all server process on
db on, game on, auth on.
If i kill db and leave others on
a log will apper
 
makes sense
 
sys_log(LL_SYS, "Reconnecting to DBCache %s:%u", GetIP().c_str(), GetPort());
this one
BASICALLY the connection is still existen with db cache
but just that socket.is_open()
make issues
 
Yeah. I didn't assume the connection was actively closed by the server.
 
12:57 AM
The is_open function just check if the socket is "open" (the open function have been successfully called), not if the socket is connected.
basic it close socket, not close connection
 
Lifetime issues with shared pointers are pretty common. And there's already one place where weak_ptr is ... misguidedly used (though it doesn't look problematic, as I mentioned before(
 
U sure u don't want the vps ?
))
or well, u already compiled it
 
not yet
@IrinelIovan yup big help. YCM helps navigation. It's okay for now
I modified the test client to link against a static lib of auth sources (except main.cpp) and used that to play around. Sadly, don't have dbserver nor authclient of course. So stopped doing that (was hoping to make a quick stress tester)
I could still do that of course by just piecing together a fake authclient, but I guess the problem really is on the lifetime of m_dbclient
I see there's a hard limit on 2^32 concurrent users :)
(And some time before that it will take a while to log on due to Monte Carlo key generation).
Not a real issue. Just a funny observation.
 
1:24 AM
@sehe you still here?
 
I am
 
wow thats ugly hold on
how do I use coliru
 
Hit the Fixed Font button
 
for (Component c = 0; c<n; ++c) {
        cout<<"community "<< c<<": ";
        vexInCom.clear();
        for (auto& mapping : mappings)
            if (mapping.second == c) {
                std::cout << " " << mapping.first;
                vexInCom.push_back(mapping.first);


            }
            std::cout << std::endl;

        vexInComWrapper.push_back(vexInCom);
    }
okay so basically i'm trying to push back different instances of this vexInCom vector to the vexInComWrapper vector
 
I see
 
1:26 AM
but when I print them out, all of the vexInCom vector's are the most recent iteration
so they are overwritten
 
1 message moved to Trash can
 
i dont think is the lifetime of dbclient
it's the lifetime too
 
?
 
sometimes when i leave over night auth process on
when i wake up
and try login
it says same besamekey
 
@CrashMan123 what's the type of vexInComWrapper? I hope you didn't use reference_wrapper :)
 
1:28 AM
vector<vector<Graph_type::vertex_descriptor>> vexInComWrapper;
    vector<Graph_type::vertex_descriptor> vexInCom;
 
I start auth now, go sleep.. when wake up auth broken.. same besamekey error sometimes.. so i guess it's a problem of lifetime too like u said.
 
haha I don't think its actually a wrapper, thats just what I thought of in my head to name it
 
@IrinelIovan Ok. What did you mean when you said "lifetime"? I think we're talking about different meanings of that word
@CrashMan123 just remove the reference - you didn't want references, you want vectors
 
i mean, if i leave over night on.. it apper same error
so after a time it closes socket
 
what do you mean reference?
 
1:30 AM
@IrinelIovan Makes sense. I meant lifetime as in /technical/ lifetime of the C++ object. So the ownership of the smart pointer.
@CrashMan123 Sorry, I misread. I thought it said reference_wrapper. Which was what I expected to see, but it's not there
 
so maybe this is the problem?
 
@CrashMan123 Okay, something doesn't add up. Here's a counter-gambit godbolt.org/z/66raqjb75. Maybe you can find the difference(s). I suppose there's a stray & somewhere. OR. Undefined Behaviour again.
@IrinelIovan It's apparent. But the question is not what's apparent. The question is what causes it:)
 
Man, really.. u need vps so u can see live
85 ECANCELED Operation canceled. The scheduled operation was canceled.
 
Okay, perhaps it's time to connect
 
thats the error returned
sometimes
 
1:37 AM
@IrinelIovan wait, what's the context
 
in NetPeer
[2021-03-18 20:33:11.448] [auth] [info] HandleRead : Error Code 2
some times 85 sometimes 2
sys_log(LL_SYS, "HandleRead : Error Code %d", e);
sys_log(LL_SYS, "HandleWrite : Error Code %d", e);
[2021-03-18 23:40:26.470] [auth] [info] HandleRead: error Operation canceled
[2021-03-18 23:41:28.307] [auth] [info] HandleRead: error End of file
Those are some logs, added by other developers from upwork which tried.. to fix
 
It's funny because on linux (POSIX?) 85 is ERESTART, not ECANCELED
 
they added error handling in NetPeer
[2021-03-19 00:39:17.800] [auth] [info] HandleRead: error Connection reset by peer
sometimes this too xd
 
Not good news when FoxNet is unreliable. I don't think the problem is there. The only active cancellation I've seen is w.r.t. the disconnect timer for delayed disconnect.
@IrinelIovan this is normal when there's a the network hiccup or the server restarts etc
 
if (e != asio::error::operation_aborted)
_this->Disconnect();
there's also this
 
1:42 AM
I'd expect it to be there when I cycled the DBcache connection like this:
[2021-04-14 03:23:37.673] [auth] [info] Connecting to account sql su@127.0.0.1:3306
[2021-04-14 03:23:37.680] [auth] [info] Connecting to DBCache 127.0.0.1:9000
[2021-04-14 03:23:37.681] [auth] [info] Binding auth server on 0.0.0.0:9886
[2021-04-14 03:23:37.681] [auth] [info] Connected to DBCache 127.0.0.1:9000
[2021-04-14 03:23:50.242] [auth] [info] Reconnecting to DBCache 127.0.0.1:9000
[2021-04-14 03:23:55.242] [auth] [info] Connected to DBCache 127.0.0.1:9000
[2021-04-14 03:23:55.243] [auth] [info] Reconnecting to DBCache 127.0.0.1:9000
@IrinelIovan yeah that's a conditional though, not active cancellation. I'd seen it.
 
So tell me, where we talk prive so i give u vps data?
 
It makes some sense to disconnect a connection when operations are canceled. Otherwise, you get corrupted streams
@IrinelIovan The email might work. I should have discord somewhere but I kinda dislike voice chat
 
an other "dev from upwork" said is good to comment
xdddddd
 
@IrinelIovan I don't think I follow what you meant there. (Language barriers are fun)
 
Another developer from upwork, told me it's good to comment this part:
f (e != asio::error::operation_aborted)
_this->Disconnect();
" developer "
 
1:47 AM
Ah. I spotted it before, and yes, that's important logic.
6 mins ago, by sehe
It's funny because on linux (POSIX?) 85 is ERESTART, not ECANCELED
What do you think about that^
Is that a BSD thing? Or something more interesting?
 
@sehe I sent you vps data on email.
U can use winscp/putty, at least that's what i use right now.
/root/src/ = source directlry
/root/serv/ = runtime files
/root/src/build && make install
 
How in sync is the source?
 
sync ?
 
up-to-date with what you sent me?
 
Yes it's updated, it's linked directly to git
yes it's same as i sent you
 
1:53 AM
Okay, any chance I can clone from git? Sometimes history is helpful (e.g. it would have told me the tracing added by other devs)
 
yes you can.. But there's no history about it.
It was wrote by him in his repo
and he just sent me
xd
Tracing it's simple if u want..
#include <spdlog/spdlog.h>

#define LL_SYS 0
#define LL_ERR 1
#define LL_CRI 2
#define LL_WARN 3
#define LL_DEV 4
#define LL_TRACE 5

inline void sys_log(int l, const char* message, ...)
{
char s[512] = {0};
va_list args;

va_start(args, message);
vsprintf(s, message, args);
va_end(args);

auto logger = spdlog::get("auth");

if (logger)
{
switch (l)
{
case LL_SYS: logger->info(s); break;
case LL_CRI: logger->critical(s); break;
case LL_ERR: logger->error(s); break;
case LL_DEV: logger->debug(s); break;
Just copy this and add in NetPeer.cpp
at begining of file.. and will work like auth logging
 
2:05 AM
thanks. Looks a lot like "just syslog" :)
 
@IrinelIovan found
 
Nice, if you add some logs and u need test u need say me.. I'm gonna move auth compiled core.. on live server, where players are.
and start and report u back
 
kk
 
I see u like chatting a lot.. there's a lot chat on cpplang too xd
slack
 
2:07 AM
I'm rarely on slack though
I guess I'm not too fond of all the distractions :)
 
ahahhagha
found you
 
indeed.
 
there u have db core too and all xd.. Actual network it uses kqueue
agh i see u do same thing as richard
xauth to connect sources to your ide
remote
 
@IrinelIovan took the liberty to apply that one - just for completeness i.imgur.com/jctr3G4.png
@IrinelIovan wrong. I'm a terminal guy
 
Nothing to worry, u can do what u wish to work more free
 
2:17 AM
It's just a force of habit to say ssh -XCt because then you /can/ launch remote UIs
@IrinelIovan Cheers
@IrinelIovan So, nothing on this machine disrupts users, right? How do I run simple tests? I could make a little stress tester.
 
If you can you can do. If you have a windows pc..
I can give u link to download game client.
And i can give u source code of client, to see how is client network
so u can make a stress stuff
as i said you can't test just me.
I have different dedicated server
where i host server with players
right now it's on beta, and i have daily 200 on
and on 16 is official start where i will have 10k players
 
@IrinelIovan I do not
@IrinelIovan Has the problem ever been reproduced on test?
 
Yes, after 10 hours of auth process on.
Over time
 
The idea is to make a repro that we CAN test without requiring live users
@IrinelIovan Good info
I know you tried to say before, but this is concrete confirmation.
 
I literally do nothing, just let auth process on.. after some time it breaks.
in term of hours
 
2:35 AM
Ah before I said the input buffer was 5000, that was the recoonect cycle (milliseconds). Both buffers default to 32k then
Not a big difference, just wrong number.
Can we distinguish the error codes? BESAMEKEY? I don't know how you can tell that the code is returned from one location and not the others.
I really don't see a way for the socket to be closed UNLESS the server was unreachable for a little while (<5 s ago, because that's the reconnect cycle)
Would authclient mind if we make it BESAMEKEY1, BESAMEKEY2 etc.
 
Ok, so u want me to change them ? BESAMEKEY1 2 3 4 ETC ?
 
If we can, then we have one doubt less.
 
allright now i do
Now if u mention this
2 minutes ago
i tried to comment completly the m_dbClient->IsConnected
and it still returns besamekey
 
See
 
so i gueess another besamekey from others 4
 
2:45 AM
My thought exactly
 
ok now, i did.. i move on live and check which besamekey
it might be a problem from amy?
amy is mysql asio library
 
@IrinelIovan I know of it. Have never used it in production code though
 
It has a memory leak anwyay
 
These days there's a Boost Mysql Asio client. Looks nice as well
 
github.com/anarthal/mysql this should be better..
yep this one
 
2:47 AM
@IrinelIovan amy? Or the auth server? That makes sense to me since there's a bit of overkill shared_ptr use and if a connection fails I'm not convinced they always get freed
 
the auth server uses amy to connect to mysql8.0
and get data from account.sql
 
I saw.
 
what the
I changed BESAMEKEY_1 BESAMEKEY_2 BESAMEKEY_3
AND still returns just BESAMEKEY
 
And some gibberish right
I don't see the change, though
 
MOMENT
 
2:51 AM
The name can only be 8 chars (plus trailing NUL):
BEGIN_PACKET_DEF(SPacketGCLoginFailure, HEADER_GC_LOGIN_FAILURE)
	char status[8 + 1];
END_PACKET_DEF(TPacketGCLoginFailure)
So, it must be BESAMKEY1 or sumtin'. Actually the original is "too long" (as in: the NUL character doesn't fit)
 
i figured
i changed to ERR_1
 
I think I'm going to sleep on it for a while
 
ERR_2
 
@IrinelIovan SHould be safer (I can't really see the client code. Or wait, maybe I can, will look)
 
WE CAN continue tommorow.. xd
ERR_1
it returns
 
2:55 AM
So OnLoginSQLQuery
 
YEP
SEEMS a eror with amy ?
 
Good. At least we made a step. I'll be here tomorrow after ~13pm
@IrinelIovan Something related in that area indeed.
 
Oh and the error
[2021-04-14 05:56:01.258] [auth] [error] Unknown error
so yes indeed.. I will recheck this part
maybe it's a wrong select
 
That would /always/ fail. But yeah, checking everything around that area makes sense.
Don't forget to sleep!
 
Ok, thanks for help.. Just tag me there when u back online.. U can go sleep
it's good i/we made a progress for now.
 
2:58 AM
Cheers
 
@sehe Damn, i figured
whats wrong now
 
sehe, have you ever attempted to calculate modularity of a graph community?
 
@sehe Solved, i mean so far works good.. So far just.
 
3:25 AM
I found HOW TO repdoduce BESAMEKEY FROM m_dbClient->IsConnected
 
 
10 hours later…
12:59 PM
@sehe U here?
 
1:12 PM
@IrinelIovan I am now. Sorry for misplanning. I had totally forgotten I had a doctor's appointment
@IrinelIovan Oh nice
@CrashMan123 I have not
 
It was an select wrong
select PASSWORD('') was removed in mysql8
 
@IrinelIovan That's awesome
 
So i had to use: CONCAT('*', UPPER(SHA1(UNHEX(SHA1('%1%')))))
and fixed that intial err_1
 
This is why you have unit tests :) But great nonetheless.
 
now it throw err_4 which is what i mentioned m_dbClient->IsConnected
when it happens?
well, when db cache send unknown header to auth
auto handler = m_handlers.find(packetId);
if (handler == m_handlers.end())
{
sys_log(LL_ERR, "Unknown Packet with id %d (%02x) received from DBCache", packetId, packetId);
Disconnect();
return 0;
}
So this one
Unknown Packet with id 182 received from DBCache
I know which packet is 182
and what it does
 
1:16 PM
Mmm. Is that not a fixable problem?
 
It should be fixable.. It need to ignore that packet that's all
when db cache receive unknown packet header, need ignore.. and read next.. but it not do that
it breaks connection with m_dbClient
i guess because Disconnect();
 
@IrinelIovan The problem is with the size, maybe. I think you might need to avoid sending the packet or install a dummy handler that actively "processes" the ignored packet (so that the correct packet size is returned from the m_handler mapped_type.second function)
@IrinelIovan Possibly reconnecting, but only after 5s
Should I still sign up on "upwork" or something? I mean, I do this kind of thing all the time, but I guess I realize it's the typical consultancy story: "Consultant: That''ll be $3,000,-" Client "But you changed a single line" Cosultant: "Yeah, it's not fixing the line, it's about finding the line to fix"
So if you feel like my time was worth something, I'll might find out how upwork works
 
1:38 PM
I'm pretty happy that [this was one of the the very first question I asked](https://chat.stackoverflow.com/transcript/message/51985283#51985283) :)
I honestly feel that all that was stopping you from seeing this bug was tunnel vision. Which is kind of why I kept holding off on looking at the live server/chasing debug logs from other devs :)
Experience does pay off. And patience.
My motto for decades: "The Expert is invariably the one with the most patience".
 
Hi, Is there any way to know how many byes are in std::wostringstream?
 
Assuming you're at the end, multiply tellp() by sizeof(wchar_t).
THe expensive way would be to `stream.str().size()*sizeof(whcar_t)` (because it allocates a copy of the stream buffer).
 
nwp
If you have C++20 use std::wostringstream::view.size().
 
upto cpp17 only! :)
 
If you're not at the end (9.0001% chance) you can use seekp en.cppreference.com/w/cpp/io/basic_ostream/seekp
 
nwp
1:43 PM
times sizeof(wchar_t)
 
does tellp convert to int?
 
@nwp I wonder whether std::as_bytes(stream.view).size() will compile. I feel it should. But knowing c++, it probably doesn't...
@Mayur It returns an integral type (pos_type)
 
so it can be converted to uint64_t!
 
Yes
 
std::as_bytes is in c++20?
yes, it is
 
2:45 PM
@sehe I can take you to do some refactors and rewrite whoke game network, u think u can handle a whole network rewrite?
 
Depends on the goal. I'd reserve professional judgement. E.g. I would not "just" advise making the auth server mutlithreaded UNLESS you can show that there's a bottleneck there. Otherwise, you're going to introduce unnecessary bugs.
So, yeah I enjoy the work in c++/asio/amy etc. The code base is not the worst (by far). So I'm interested, on the assumption that the task is useful. That's my benchmark for gigd.
 
3:14 PM
@sehe Look my last commit pls, i fixed unknown header from db to auth.
Basically i marked which peer is auth and skipped
* authservers are properly identified now
Fixed all related issues with auths receiving data they shouldnt and fixed some invalid auth checks
I want move whole server source to C++, and refactor whole server source.
I want a rewrite of sectree/sectree_manager etc
and more
not just netwrk
 
 
3 hours later…
5:47 PM
@sehe What's wage? How u want payment, u want per things to do or per hour.. etc
 
 
4 hours later…
10:10 PM
@IrinelIovan lol bd32018
in principle the approach I [recommended](https://chat.stackoverflow.com/transcript/message/51989632#51989632) - better than dummy handlers (increases coupling).
The code looks a little surprising (apparently there was already a similar legacy flag fir "slave auth"? What is `@correction100` about, suddenly; is there a specific reason not to indent the new conditional blocks etc.)
All in allI'd say the biggest worry is the sheer amount of change. But it does all look pretty natural (except the conditionals in game/main.cpp, which are a bit magical)
 
 
1 hour later…
11:24 PM
I think I just pieced together that you're \@Ramy from 2015... Oh the blessings of being forgetful for trivia or names.
 
@sehe
Yes i am ))))))))))))))))
and really ?
2015 ?
 
Yup. Time flies
@IrinelIovan W.r.t to the dev work offer I think I stand by my old stance:
in Lounge<C++>, Oct 10 '16 at 15:40, by sehe
@TannerSansbury I don't need to completely prejudice you about Ramy, but let's say he's quite desperate for ~a year now to get me to fix his ASIO woes for a shady game project. The main thing driving me away is the fact that the project only exists due to leaked source code from a commercial game, and his clinginess. Just saying so you don't need to waste too much time.
I must say the code looks nicer than what I remember - because I didn't run away screaming. Maybe my standards have dropped. Or I just got so much more capable of grokking complicated code.
 
I will do a packet dispatcher and a packet handler to fix that .. maybe
and really i don't remeber
what was back then
The problem is i could not fid good developers
 
@IrinelIovan I tried UpWork but it requires me to have a business (W-8BEN) and also other terms of service I may not like (requiring address and provision).
I can give you my paypal and you can just decide what you want to "tip" me
 
So, dont u have some private contact?
U accept crypto
?
Auth seems fine so far, work good.
It's on since 1-2h
 
11:28 PM
@IrinelIovan I do not
 
with a stress of 150 people login same time
 
@IrinelIovan Awesome. Well done
 
After i skipped sending un needed packets seems ok.
 
I'm glad that the deadline crisis seems averted. Always be prepared, there will be more surprises, but hopefully no roadblocks
 
About code, i did some refactors.
if u look game/src/_CCommandManager stuff
i rewrote but need finish em
and yes it was more ugly
 
11:46 PM
Looks clean, not very efficient. And also, looks like it just does nothing yet. Does "unstuck" work already? (And interpret_commandagain? That would lead to "You are not stuck" messages even if the CommandUnstuckalready worked, right?
 
Yes, unstuck work very good.
I just need to port all other commands
to new command mannager
it's just
Initial implement..
 

« first day (1738 days earlier)      last day (1105 days later) »