IPB

Здравствуйте, гость ( Вход | Регистрация )

11 страниц V  « < 8 9 10 11 >  
Reply to this topicStart new topic
> T-800 Mod
t800
сообщение 07 Oct 2016, 22:03 (Сообщение отредактировал t800 - 08 Oct 2016, 08:09)
Сообщение #181

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Так ну вроде получилось письмо с сейвом из Ubuntu отосласть

Вот правильные каманды



Код
echo -e "Subject: Turnir\n MIME-Version: 1.0\n Content-Disposition: attachment;\n filename="autosave.sav"\n Content-Transfer-Encoding: base64\n Content-Type: application/octet-stream;\n name="autosave.sav"\n" > email-contents.txt


Потом

Код
base64  autosave.sav >> email-contents.txt


B конце

Код
curl "smtp://wiki.kvkozyrev.org:25" --mail-from "t800@kvkozyrev.org" --mail-rcpt "t800@kvkozyrev.org"  -T email-contents.txt


И тогда на почту приходит письмо с автосейвом.

ЗЫ Правда работают этм каманды только под Ubuntu тепеть надо разоботься как это сделать в Windows и Android


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 08 Oct 2016, 14:34 (Сообщение отредактировал t800 - 08 Oct 2016, 14:45)
Сообщение #182

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Скачал в Andriond 5.0 который у меня стои в Virtualbox curl который собран для Andriod https://curl.haxx.se/download.html

Хмм... Честно говоря как то не очень получается... Во-первых оказалось что с SDcard и папки где лежат игры его запускать нельзя потому что прав у него нету и если пыпасться поставить права командой

Код
chmod 777 curl


Права не устанавливаются. Я погуглил оказывается в Andriond для всего что лежит на SDcard права заданы только на чтение-запись и чтобы curl запустился надо положить его в папку system/bin

Тогда я cкопироал curl в папку system/bin

Код
cp curl system/bin


Присвоил ему права на выполнение

Код
chmod 777 /system/bin/curl



запусил камандой curl и получил ошибку

Код
sh:system/bin/curl: not executable: 32 ELF file


Погуглил ошибку оказалось что это значит что программа собрана без поддержки x86 budo.gif

Хммм... Как то не очень хорошо с этим curl под Аndriod получается


И как быть? Как я понимаю: можно попробовать собрать свой curl под Android из исходников так чтобы нужные мне устройства он поддерживал потому что исходники curl на https://curl.haxx.se/download.html есть

И еще я подумал а может просто попробовать скопировть из curl те каманды где он отправляет e-mail и
пусть игра сама письмо отравляет без всякого curl ? Потому что из папки где лежат файлы игры curl работать не будет и получается надо делать еще установку curl и в папку system/bin его кидать и права ему как-то присваивать, а чтобы это сделать надо root быть и как это сделать чтобы при установке на чужих устройствах получалось не совсем понятно.


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 08 Oct 2016, 16:51 (Сообщение отредактировал t800 - 08 Oct 2016, 16:57)
Сообщение #183

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Так вроде получилось вручную отослать autosave.sav Curl-ом из под Andriond



Для пришлось взять Curl из другой сборки (более новой) и

И командами cейв послать удалось и из под обычного пользователя. Единственная проблема что для того чтобы это сделать пришлось сперва рутом менять права файлов сперва самого curl


Код
chmod 777 system/xbin/curl


потом файла

Код
chmod 777 lib/libcurl.so.5


Соотвественно вопрос а можно как то сделать чтобы при людям не нужно было менять права этих файлов из под root потому что root он не у всех есть. У меня на планшете например нет и root есть только в VirtualBox-e


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 09 Oct 2016, 07:18 (Сообщение отредактировал t800 - 09 Oct 2016, 08:29)
Сообщение #184

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Так я попробовал сделать следующее. В гугле по запросу "где лежат исполняемые файлы программ Androind" я прочитал что они лежат в

Код
data/app/



тогда я скопировал файл curl в data/app/wiki.kvkozyrev.org.fheroes2-t800/


Код
cp system/xbin/curl  data/app/wiki.kvkozyrev.org.fheroes2-t800/


И попробовал его оттуда запустить

Код
./data/app/wiki.kvkozyrev.org.fheroes2-t800/curl


и он запустился нормально

тогда я туда же переложил из папки lib файл libcurl.so.5

Код
mv lib/libcurl.so.5 data/app/wiki.kvkozyrev.org.fheroes2-t800/


и попробовал опять запустить curl камандой

Код
./data/app/wiki.kvkozyrev.org.fheroes2-t800/curl


но он не запустился сказав

Код
CANNOT LINK EXECUTABLE DEPENDENCIES:  library "curl.so.5" not found


Что делать? Почему curl не видит curl.so.5 хотя она лежит с ним в одной папке?
И куда ее надо положить так чтобы для этого не нужно было прав root но так чтобы curl ее видел?


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
feanor
сообщение 09 Oct 2016, 11:28 (Сообщение отредактировал feanor - 09 Oct 2016, 11:30)
Сообщение #185

laughed as one fey
Сообщений: 12 167
Спасибо сказали: 20602 раза




Да, чот я не сообразил за мультиплатформенность.
Цитата
И еще я подумал а может просто попробовать скопировть из curl те каманды где он отправляет e-mail и
пусть игра сама письмо отравляет без всякого curl ?

Тогда надо вручную реализовывать хотя бы на тех же SDL-шных сокетах (чтобы лишний раз не мудохаться с той же кроссплатформенностью) протокол SMTP.
Он не особенно сложный, в принципе, текстовое общение с сервером да base-64 кодирование файлов, ну и вытащить его реализацию можно много откуда, но оно точно надо?
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 09 Oct 2016, 12:50 (Сообщение отредактировал t800 - 09 Oct 2016, 12:52)
Сообщение #186

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Цитата(feanor @ 09 Oct 2016, 14:28) *
Да, чот я не сообразил за мультиплатформенность.
Цитата
И еще я подумал а может просто попробовать скопировть из curl те каманды где он отправляет e-mail и
пусть игра сама письмо отравляет без всякого curl ?

Тогда надо вручную реализовывать хотя бы на тех же SDL-шных сокетах (чтобы лишний раз не мудохаться с той же кроссплатформенностью) протокол SMTP.
Он не особенно сложный, в принципе, текстовое общение с сервером да base-64 кодирование файлов, ну и вытащить его реализацию можно много откуда, но оно точно надо?


Ну VDV_forever сказал что надо сделать турнирную вкладку в игру и чтобы можно было каждый месяц добавлять по одиночной турнирной карте, а Qwerty вообще сказал что для честного судейства надо так сделать чтоб ведущему могли отсылалист турнирыне сейвы на начало и конец дня.



Цитата(feanor @ 09 Oct 2016, 14:28) *
Да, чот я не сообразил за мультиплатформенность.
Цитата
И еще я подумал а может просто попробовать скопировть из curl те каманды где он отправляет e-mail и
пусть игра сама письмо отравляет без всякого curl ?

Тогда надо вручную реализовывать хотя бы на тех же SDL-шных сокетах (чтобы лишний раз не мудохаться с той же кроссплатформенностью) протокол SMTP.
Он не особенно сложный, в принципе, текстовое общение с сервером да base-64 кодирование файлов, ну и вытащить его реализацию можно много откуда.


Значит получается будет проще попробовать сделать самому за примера из SDL, чем пытаться этот curl во все сборки запихнуть и настроить чтоб нормально работал?


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 09 Oct 2016, 13:47
Сообщение #187

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Вот нашел в Google исходник какого то клиента на SDL_net


Код
// SDL_net Client | r3dux.org | 14/01/2011

// Includes for non-blocking keyboard input
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <termios.h> // If we do not include termios.h the client WILL compile but it WILL NOT WORK!
#include <unistd.h>
#include <fcntl.h>

#include <iostream>
#include <string>

#include <SDL_net.h>

using namespace std;

const unsigned short PORT        = 1234; // The port we are connecting to
const unsigned short BUFFER_SIZE = 512;  // Size of our message buffer (i.e. maximum length of characters in a message)

struct termios orig_termios;

// Function to reset the terminal to blocking mode
void reset_terminal_mode()
{
    tcsetattr(0, TCSANOW, &orig_termios);
}

// Sets the terminal mode to conio mode
void set_conio_terminal_mode()
{
    struct termios new_termios;

    // Take two copies - one for now, one for later
    tcgetattr(0, &orig_termios);
    memcpy(&new_termios, &orig_termios, sizeof(new_termios));

    // register cleanup handler, and set the new terminal mode
    //atexit(reset_terminal_mode); // Commented out because I switch and swap terminal modes a lot - just remember to call reset_terminal_mode() when we finish up
    cfmakeraw(&new_termios);
    tcsetattr(0, TCSANOW, &new_termios);
}

// Fuction to check if a key has been pressed
int kbHit()
{
    // How long to wait for input
    // Note: As soon as we get input the wait is immediately over - so it's not like our typing rate is limited in any way!
    long waitSeconds      = 1L;
    long waitMicroSeconds = 0L;
    struct timeval tv = { waitSeconds, waitMicroSeconds };

    // Create a file descriptor set
    fd_set fds;

    FD_SET(0, &fds);
    return select(1, &fds, NULL, NULL, &tv);
}

// Function to read the contents of the keypress
int getch()
{
    int r;
    unsigned char c;
    if ((r = read(0, &c, sizeof(c))) < 0)
    {
        //cout << "About to return a number..." << endl;
        return r;
    }
    else
    {
        //cout << "About to return a character..." << endl;
        return c;
    }
}

int main(int argc, char **argv)
{
    const char *host;         // Where we store the host name

    IPaddress serverIP;       // The IP we will connect to
    TCPsocket clientSocket;   // The socket to use
    string    serverName;     // The server name

    string userInput = "";    // A string to hold our user input
    int inputLength  = 0;     // The length of our string in characters
    char buffer[BUFFER_SIZE]; // Array of character's we'll use to transmit our message. We get input into the userInput string for ease of use, then just copy it to this character array and send it.

    // Initialise SDL_net
    if (SDLNet_Init() < 0)
    {
        cout << "Failed to intialise SDN_net: " << SDLNet_GetError() << "\n";
        exit(-1); // Quit!
    }

    // Ask the user for a server to connect to - can be entered as a hostname (i.e. localhost etc.) or an IP address (i.e. 127.0.0.1 etc.)
    cout << "Server Name: ";
    //getline(cin, serverName); // Uncomment this and remove the below line to change the server we're connecting to...
    serverName = "localhost";

    // Create the socket set with enough space to store our desired number of connections (i.e. sockets)
    SDLNet_SocketSet socketSet = SDLNet_AllocSocketSet(1);
    if (socketSet == NULL)
    {
        cout << "Failed to allocate the socket set: " << SDLNet_GetError() << "\n";
        exit(-1); // Quit!
    }
    else
    {
        cout << "Successfully allocated socket set." << endl;
    }

    // Try to resolve the host. If successful, this places the connection details in the serverIP object
    int hostResolved = SDLNet_ResolveHost(&serverIP, serverName.c_str(), PORT);

    if (hostResolved == -1)
    {
        cout << "Failed to resolve the server hostname: " << SDLNet_GetError() << "\nContinuing...\n";
    }
    else // If we successfully resolved the host then output the details
    {
        // Get our IP address in proper dot-quad format by breaking up the 32-bit unsigned host address and splitting it into an array of four 8-bit unsigned numbers...
        Uint8 * dotQuad = (Uint8*)&serverIP.host;

        //... and then outputting them cast to integers. Then read the last 16 bits of the serverIP object to get the port number
        cout << "Successfully resolved host to IP: " << (unsigned short)dotQuad[0] << "." << (unsigned short)dotQuad[1] << "." << (unsigned short)dotQuad[2] << "." << (unsigned short)dotQuad[3];
        cout << " port " << SDLNet_Read16(&serverIP.port) << endl << endl;
    }

    // Try to resolve the IP of the server, just for kicks
    if ((host = SDLNet_ResolveIP(&serverIP)) == NULL)
    {
        cout << "Failed to resolve the server IP address: " << SDLNet_GetError() << endl;
    }
    else
    {
        cout << "Successfully resolved IP to host: " << host << endl;
    }

    // Flag to keep track of when to disconnect and finish up. We initially set it so that we CANNOT connect, and only change this to false when we got an "OK" response from the server
    bool shutdownClient = true;

    // Try to open a connection to the server and quit out if we can't connect
    clientSocket = SDLNet_TCP_Open(&serverIP);
    if (!clientSocket)
    {
        cout << "Failed to open socket to server: " << SDLNet_GetError() << "\n";
        exit(-1);
    }
    else // If we successfully opened a connection then check for the server response to our connection
    {
        cout << "Connection okay, about to read connection status from the server..." << endl;

        // Add our socket to the socket set for polling
        SDLNet_TCP_AddSocket(socketSet, clientSocket);

        // Wait for up to five seconds for a response from the server
        // Note: If we don't check the socket set and WAIT for the response, we'll be checking before the server can respond, and it'll look as if the server sent us nothing back
        int activeSockets = SDLNet_CheckSockets(socketSet, 5000);

        cout << "There are " << activeSockets << " socket(s) with data on them at the moment." << endl;

        // Check if we got a response from the server
        int gotServerResponse = SDLNet_SocketReady(clientSocket);

        if (gotServerResponse != 0)
        {
            cout << "Got a response from the server... " << endl;
            int serverResponseByteCount = SDLNet_TCP_Recv(clientSocket, buffer, BUFFER_SIZE);

            cout << "Got the following from server: " << buffer << "(" << serverResponseByteCount << " bytes)" << endl;

            // We got an okay from the server, so we can join!
            if ( strcmp(buffer, "OK") == 0 )
            {
                // So set the flag to say we're not quitting out just yet
                shutdownClient = false;

                cout << "Joining server now..." << endl << endl;
            }
            else
            {
                cout << "Server is full... Terminating connection." << endl;
            }
        }
        else
        {
            cout << "No response from server..." << endl;
        }

    } // End of if we managed to open a connection to the server condition

    bool wrotePrompt = false; // Whether or not we've already written the prompt
    bool sendMessage = false; // Whether or not it's time to send the message (flips to true when the user presses return)

    // While it's not time to shutdown the client...
    while (shutdownClient == false)
    {
        // Write the prompt only once per line of input. This gets reset so that it's displayed again after a message is sent
        if (wrotePrompt == false)
        {
            cout << "Write something:" << endl;
            wrotePrompt = true;
        }

        // If we've detected that the user has pressed a key..
        set_conio_terminal_mode();
        int status = kbHit();
        reset_terminal_mode();

        //cout << "status is: " << status << endl;

        if (status != 0)
        {
            //cout << "key was pressed and status is" << status << endl;

            // Get the keypress
            set_conio_terminal_mode();
            char theChar = getch();
            reset_terminal_mode();

            // Output the character to stdout
            cout << theChar;

            // Flush the character to the screen
            fflush(stdout);

            // If the keypressed wasn't return then add the character to our message string
            if ((int)theChar != 13)
            {
                //cout << "Got the character: " << theChar << " (which is number: " << int(theChar) << ")" << endl;

                // Add the character to our input string
                userInput += theChar;
            }
            else // Otherwise (if the user pressed enter) then send the message
            {
                //cout << "user pressed return" << endl;

                // Copy our user's string into our char array called "buffer"
                strcpy( buffer, userInput.c_str() );

                // Calculate the length of our input and then add 1 (for the terminating character) to get the total number of characters we need to send
                inputLength = strlen(buffer) + 1;

                // Send the message to the server
                if (SDLNet_TCP_Send(clientSocket, (void *)buffer, inputLength) < inputLength)
                {
                    cout << "Failed to send message: " << SDLNet_GetError() << endl;
                    exit(-1);
                }
                else
                {
                    //cout << "Message sent successfully." << endl;

                    // If we've asked the server to shutdown or we want out then set the flag appropriately
                    if (sendMessage == true && (userInput == "quit" || userInput == "exit" || userInput == "shutdown"))
                    {
                        shutdownClient = true;
                    }

                    // Reset for the next message
                    cout << endl;
                    wrotePrompt = false;
                    sendMessage = false;
                    userInput = "";
                }

            } // End of message sending section

        } // End of if the user pressed a key test

        // Check our socket set for activity. Don't wait if there's nothing on the socket just continue
        int socketActive = SDLNet_CheckSockets(socketSet, 0);

        //cout << "Sockets with data on them at the moment: " << activeSockets << endl;

        if (socketActive != 0)
        {
            // Check if we got a response from the server
            int messageFromServer = SDLNet_SocketReady(clientSocket);

            if (messageFromServer != 0)
            {
                //cout << "Got a response from the server... " << endl;
                int serverResponseByteCount = SDLNet_TCP_Recv(clientSocket, buffer, BUFFER_SIZE);

                cout << "Received: " << buffer << endl;// "(" << serverResponseByteCount << " bytes)" << endl;

                if (strcmp(buffer, "shutdown") == 0)
                {
                    cout << "Server is going down. Disconnecting..." << endl;
                    shutdownClient = true;
                }
            }
            else
            {
                //cout << "No response from server..." << endl;
            }

        } // End of if socket has activity check

    } // End of main while loop

    // Close our socket, cleanup SDL_net, reset the terminal mode and finish!
    SDLNet_TCP_Close(clientSocket);

    SDLNet_Quit();

    reset_terminal_mode();

    return 0;
}


Если я правилно понял мне для отправки письма мне надо поменять PORT = 1234 на PORT = 25 и указать свой сервер wiki.kvkozyrev.org?


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 09 Oct 2016, 15:26 (Сообщение отредактировал t800 - 09 Oct 2016, 15:30)
Сообщение #188

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Ну я сейчас собрал этот пример вот такой камандой

Код
g++ client.cc -w -lSDL_net -o client


Только пришлось почему то поменять в нем строчку

Код
#include <SDL_net.h>


на

Код
#include </usr/include/SDL/SDL_net.h>


потому что он почему ругался что не может найти файл SDL_net.h

Так ну запустил этот клиент который собрал из примера он мне выдал вот такое

Код
danya@danya:~/hello$ ./client
Server Name: Successfully allocated socket set.
Successfully resolved host to IP: 217.11.71.62 port 25
Failed to resolve the server IP address:
Connection okay, about to read connection status from the server...
There are 1 socket(s) with data on them at the moment.
Got a response from the server...
Got the following from server: 220 wiki.kvkozуrev.org ESMTP Postfix (Ubuntu)
(43 bytes)
Server is full... Terminating connection.


И завершился.


Так какие каманды надо в него написать чтоб он е-mail отправил?


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 09 Oct 2016, 21:11
Сообщение #189

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Ладно пример чата на SDL_net у меня заработал а как письма отправилять разбираться наверно потом буду.


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 10 Oct 2016, 17:08
Сообщение #190

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Итак я нагуглил исходники программы корая сделана на SDL_net и умеет отсылает тектовые сообщения на e-mail
и подумал и решил что делать наверное будут так

1) Возьму код программы которая сдалана на SDL_net и умеет отсылать текстовые сообщения по почте
2) И изменю его чтобы она умела отсылать файлы проверю что все работает
3) А потом вставлю код этой программы в игру. Вот.


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 14 Oct 2016, 17:13
Сообщение #191

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Так разобрался с заголовками для оправки почты вот таким должен быть закодированный файл подготовленный для оправки двух файлов кодом SDLmail

Код
Subject: Turnir
MIME-Version: 1.0
Content-Type: multipart/mixed;
        boundary=----==--wiki.kvkozyrev.org
------==--wiki.kvkozyrev.org
Content-Transfer-Encoding: 7bit
Content-Type: text/html

Turnir=T-800
Days=190
Name=Ivan Ivanov


------==--wiki.kvkozyrev.org
Content-Disposition: attachment;
    filename=fheroes2.hgsc
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream;
    name=fheroes2.hgsc

AAAAaQAAAEoAAAAAeJz7+JmBgYEZiDlT9RKLEkuqUsuAHNYQXQsDg/B3FV+BnGAGBkZvHCreXk8G
ckKAKjyBNFtheWpRSSWSAX28QE40UNoJAEJ4GBE=
------==--wiki.kvkozyrev.org
Content-Disposition: attachment;
        filename=fheroes2.hgs
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream;
        name=fheroes2.hgs

AAAAaQAAAEoAAAAAeJz7+JmBgYEZiDlT9RKLEkuqUsuAHNYQXQsDg/B3FV+BnGAGBkZvHCreXk8G
ckKAKjyBNFtheWpRSSWSAX28QE40UNoJAEJ4GBE=
------==--wiki.kvkozyrev.org


Разобрался просто: сперва отравил себе на почту два файла через Yandeх почту, посмотрел код полученного сообщения и погулил что значит каждая из строчек.


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 15 Oct 2016, 22:13 (Сообщение отредактировал t800 - 15 Oct 2016, 22:14)
Сообщение #192

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Фух сделал со всеми заголовками
Код
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "base64.h"


int SendText ()
{                              
    char * TextBuf = (char*) malloc(sizeof(char) * 1024);
    FILE * ptrFile = fopen ( "output.txt" , "wb" );
    strcat(TextBuf,"Subject: Turnir\n");
    strcat(TextBuf,"MIME-Version: 1.0\n");
    strcat(TextBuf,"Content-Type: multipart/mixed;\n");
    strcat(TextBuf,"\tboundary=----==--wiki.kvkozyrev.org\n");
    strcat(TextBuf,"------==--wiki.kvkozyrev.org\n");
    strcat(TextBuf,"Content-Transfer-Encoding: 7bit\n");
    strcat(TextBuf,"Content-Type: text/html\n");
    strcat(TextBuf,"\n");
    //Здесь пищем турнирные данные в файл
    strcat(TextBuf,"Turnir=T-800<br/>\n");
    strcat(TextBuf,"Days=190<br/>\n");
    strcat(TextBuf,"Name=Ivan Ivanov<br/>\n");
    strcat(TextBuf,"------==--wiki.kvkozyrev.org\n");
    fputs(TextBuf, ptrFile);
    memset(TextBuf, 0, sizeof(TextBuf));
    fclose (ptrFile);
    return (0);
}

int Send(const char *FileName)
{
unsigned int q, i,res;
FILE* hFile = NULL;
hFile = fopen(FileName,"rb");

        if(hFile == NULL)
          {
              fputs("Ошибка файла \n", stderr);
              exit(1);
              }

  // определяем размер файла
  fseek(hFile , 0 , SEEK_END);                          // устанавливаем позицию в конец файла
  long lSize = ftell(hFile);                            // получаем размер в байтах
  q = lSize/54+1;
  rewind (hFile);                                       // устанавливаем указатель в конец файла

  char * SendBuf = (char*) malloc(sizeof(char) * lSize);
  char * FileBuf = (char*) malloc(sizeof(char) * lSize); // выделить память для хранения содержимого файла
  char * TitleBuf = (char*) malloc(sizeof(char) * 1024);
  if (FileBuf  == NULL)
     {
      fputs("Ошибка памяти", stderr);
      exit(2);
     }
    // Делаем буфер:
    fseek (hFile,0,SEEK_SET);
    FILE * ptrFile = fopen ( "output.txt" , "ab" );
//Пишем заголовки
    memset(SendBuf, 0, sizeof(SendBuf)); // чистим буфер от мусора
    memset(TitleBuf, 0, sizeof(TitleBuf)); // чистим буфер от мусора
    strcat(TitleBuf,"Content-Disposition: attachment;\n");
    strcat(TitleBuf,"\tfilename=");
    strcat(TitleBuf,FileName);
    strcat(TitleBuf,"\n");
    strcat(TitleBuf,"Content-Transfer-Encoding: base64\n");
    strcat(TitleBuf,"Content-Type: application/octet-stream;\n");
    strcat(TitleBuf,"\tname=");
    strcat(TitleBuf,FileName);
    strcat(TitleBuf,"\n\n");
    fputs(TitleBuf, ptrFile);
//Кодируем и пищем файл
    for(i=0;i<q;i++)
    {
        res = fread(FileBuf,sizeof(char),54,hFile);
        strcat(SendBuf,base64_encode(reinterpret_cast<const unsigned char*>(FileBuf),res).c_str());
        strcpy(SendBuf,base64_encode(reinterpret_cast<const unsigned char*>(FileBuf),res).c_str());
        strcat(SendBuf,"\r\n");
        fputs(SendBuf, ptrFile);
    }
    memset(SendBuf, 0, sizeof(SendBuf));
    strcat(SendBuf,"------==--wiki.kvkozyrev.org\n");
    fputs(SendBuf, ptrFile);
    fclose (ptrFile);
    fclose (hFile);
  return(0);
}

int main() {
SendText();
Send("fheroes2.hgs");
Send("fheroes2.hgsc");
Send("autosave.sav");
return 0;
}


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 18 Oct 2016, 10:01
Сообщение #193

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Собираюсь вставлять оправки файлов по e-mail код в игру.

У меня вопрос сеййчас прочитал про всякие классы и конструкторы деструкторы и меня возник вопрос?
А их обязательно делать? И можно просто попробовтаь вставить код без созданий всяких классов, конструкторов и деструкоторов.



--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
Эроласт
сообщение 18 Oct 2016, 15:08
Сообщение #194

Зануда
Сообщений: 2 237
Спасибо сказали: 2899 раз




Цитата(feanor @ 14 Oct 2016, 22:01) *
СРОЧНО УЧЕБНИК
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 18 Oct 2016, 16:10 (Сообщение отредактировал t800 - 18 Oct 2016, 20:12)
Сообщение #195

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Цитата(Эроласт @ 18 Oct 2016, 18:08) *
Цитата(feanor @ 14 Oct 2016, 22:01) *
СРОЧНО УЧЕБНИК



А что учебник? В учебнике разные непонятные вещи написаны. Какие то классы какие то ООП и все такое.
А для чего это надо и для нужно ли это вообще ни слова не сказано. Я только понял что если делать через классы
то делать придется в несколько раз дольше. Потому что тот код который уже работает без всяких классов сделан.

Поэтому и спрашиваю, а обязательно нужно делать эти классы или можно просто вставить тот код что уже есть и все?


--------------------
Go to the top of the pageAdd Nick
 
+Quote Post
feanor
сообщение 19 Oct 2016, 15:27
Сообщение #196

laughed as one fey
Сообщений: 12 167
Спасибо сказали: 20602 раза




Пока что можно и без классов, хрен с ними.
Классы для удобства делаются.


Спасибо сказали:
Go to the top of the pageAdd Nick
 
+Quote Post
fireman
сообщение 21 Oct 2016, 00:52 (Сообщение отредактировал fireman - 21 Oct 2016, 02:02)
Сообщение #197

Immortal
Сообщений: 2 768
Спасибо сказали: 959 раз




BolgenOS 2.0 потому что из видео создаётся впечатление, что ты сам всё создал. На вопросы журналистов, о создание игры, надо было поправить, что ты создал форк к свободному движку, а графику, музыку, идею игру разработали ещё давно NWC.

P.S. Обидно, что журналисты даже не пытаются разобраться и создают очередной BolgenOS.
P.S.S. Советую на ютубе добавить в описание видео, что журналистка не совсем верно поняла, и пояснить что конкретно ты разработал. Если видео внезапно разлетится по интернету, то может начаться травля.

Цитата

Не стоит делать столько разных шрифтов на одной картинке, столько выделений.
Go to the top of the pageAdd Nick
 
+Quote Post
DrSlash
сообщение 21 Oct 2016, 05:23
Сообщение #198


Сообщений: 2 042
Спасибо сказали: 8100 раз




Цитата(fireman @ 21 Oct 2016, 00:52) *
Обидно, что журналисты даже не пытаются разобраться и создают очередной BolgenOS.

А мне кажется, что они-то как раз понимают о чём речь, но им выгоднее раздуть сенсацию на ровном месте. Если взглянуть на новости, то там половина сюжетов такие (взять хотя бы сражение с ветряными мельницами в лице Pokemon Go).
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 21 Oct 2016, 07:26 (Сообщение отредактировал t800 - 21 Oct 2016, 14:41)
Сообщение #199

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Цитата(fireman @ 21 Oct 2016, 03:52) *
BolgenOS 2.0 потому что из видео создаётся впечатление, что ты сам всё создал. На вопросы журналистов, о создание игры, надо было поправить, что ты создал форк к свободному движку, а графику, музыку, идею игру разработали ещё давно NWC.

P.S. Обидно, что журналисты даже не пытаются разобраться и создают очередной BolgenOS.
P.S.S. Советую на ютубе добавить в описание видео, что журналистка не совсем верно поняла, и пояснить что конкретно ты разработал. Если видео внезапно разлетится по интернету, то может начаться травля.


Ну вобще то в моей сборке и без того ведь большими буквами написано что я сделал только T-800 mod и Поддержку кампаний.



И тетеньке этой я сказал, что сделал только одну кампанию и изменил портреты. И том ролике которая я сам делал (и который к сборке приложен в описании, и который все смотрят) я говорю, что сделал только кампании.



А то что тетенька с телевидения от себя наговорила, ну наверное захотелось ей так...

PS Вообще этот ролик который с TV по-моему никто и не смотрит (всего 48 просмотров) и все смотрят ролик котрый мой и который с со сборкой идет (2300 просмотров) хотя примечание наверное можно написать.

PPPS Сейчас добавил примечание с пояснением к ролику с TB и с ссылками на соотвествующие тему на DF2 и HandbookHMM


--------------------


Спасибо сказали:
Go to the top of the pageAdd Nick
 
+Quote Post
t800
сообщение 26 Dec 2016, 20:38 (Сообщение отредактировал t800 - 26 Dec 2016, 21:56)
Сообщение #200

Разработчик
Сообщений: 534
Спасибо сказали: 222 раза




Читая сборник рубайат Омара Хайама, мне захотелось их послушать. Но на YouTube везде какая-то совсем не та музыка на заднем плане, которую я хотел. И вот, я обозначил несколько рубай галочками, включил heroes 2 (t800 Mod) и под музик-пак прочёл их. В общем, вот что получилось:



--------------------
Go to the top of the pageAdd Nick
 
+Quote Post

11 страниц V  « < 8 9 10 11 >
Reply to this topicStart new topic
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 



Текстовая версия Сейчас: 17 September 2025 - 22:33
Copyright by Алексей Крючков
Strategy Gamez by GrayMage
Programming by Degtyarev Dmitry
  Яндекс.Метрика